⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpsconnection.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Sep 24 14:57:48 PDT 2003 -->
<TITLE>
MID Profile: Interface  HttpsConnection
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/HttpsConnection.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<strong>MID Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/io/HttpConnection.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/io/InputConnection.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="HttpsConnection.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.microedition.io</FONT>
<BR>
Interface  HttpsConnection</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/microedition/io/Connection.html">Connection</A>, <A HREF="../../../javax/microedition/io/ContentConnection.html">ContentConnection</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html">HttpConnection</A>, <A HREF="../../../javax/microedition/io/InputConnection.html">InputConnection</A>, <A HREF="../../../javax/microedition/io/OutputConnection.html">OutputConnection</A>, <A HREF="../../../javax/microedition/io/StreamConnection.html">StreamConnection</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>HttpsConnection</B><DT>extends <A HREF="../../../javax/microedition/io/HttpConnection.html">HttpConnection</A></DL>

<P>
This interface defines the necessary methods and constants to establish a secure network connection. The URI format with scheme <CODE>https</CODE> when passed to <CODE>Connector.open</CODE> will return a  <code>HttpsConnection</code>. <A HREF="http://www.ietf.org/rfc/rfc2818.txt">RFC 2818</A>  defines the scheme. <p> A secure connection MUST be implemented by one or more of the following specifications: <UL> <LI>HTTP over TLS as documented in  <A HREF="http://www.ietf.org/rfc/rfc2818.txt">RFC 2818</A> and TLS Protocol Version 1.0 as specified in <A HREF="http://www.ietf.org/rfc/rfc2246.txt">RFC 2246</A>. <LI>SSL V3 as specified in    <A HREF="http://home.netscape.com/eng/ssl3/draft302.txt">    The SSL Protocol Version 3.0</A> </LI> <LI>WTLS as specified in 	<A HREF="http://www.wapforum.org/what/technical_1_2_1.htm"> 	WAP Forum Specifications June 2000 (WAP 1.2.1) conformance release</A> 	- Wireless Transport Layer Security document WAP-199. <LI>WAP(TM) TLS Profile and Tunneling Specification as specified	in <A HREF="http://www.wapforum.com/what/technical.htm">	WAP-219-TLS-20010411-a</A> </UL> <p> HTTPS is the secure version of HTTP (IETF RFC2616),  a request-response protocol in which the parameters of the request must  be set before the request is sent. <p> In addition to the normal <code>IOExceptions</code> that may occur during  invocation of the various methods that cause a transition to the Connected state, <code>CertificateException</code> (a subtype of <code>IOException</code>) may be thrown to indicate various failures related to establishing the secure link.  The secure link is necessary in the <code>Connected</code> state so the headers can be sent securely. The secure link may be established as early as the invocation of <code>Connector.open()</code> and related   methods for opening input and output streams and failure related to certificate exceptions may be reported. </p><br> <b>Example</b><br> <p>Open a HTTPS connection, set its parameters, then read the HTTP response.</p> <code>Connector.open</code> is used to open the URL  and an <code>HttpsConnection</code> is returned. The HTTP headers are read and processed. If the length is available, it is used to read the data in bulk. From the  <code>HttpsConnection</code> the <code>InputStream</code> is opened. It is used to read every character until end of file (-1). If an exception is thrown the connection and stream are closed.  <code><PRE>     void getViaHttpsConnection(String url)             throws CertificateException, IOException {         HttpsConnection c = null;         InputStream is = null;         try {             c = (HttpsConnection)Connector.open(url);              // Getting the InputStream ensures that the connection             // is opened (if it was not already handled by             // Connector.open()) and the SSL handshake is exchanged,             // and the HTTP response headers are read.             // These are stored until requested.             is = c.openDataInputStream();              if c.getResponseCode() == HttpConnection.HTTP_OK) {                 // Get the length and process the data                 int len = (int)c.getLength();                 if (len &gt; 0) {                     byte[] data = new byte[len];                     int actual = is.readFully(data);                     ...                 } else {                     int ch;                     while ((ch = is.read()) != -1) {                         ...                     }                 }             } else {               ...             }         } finally {             if (is != null)                 is.close();             if (c != null)                 c.close();         }     } </PRE> </code>
<P>
<DL>
<DT><B>Since: </B><DD>MIDP 2.0</DD>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/pki/CertificateException.html"><CODE>CertificateException</CODE></A></DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="fields_inherited_from_class_javax.microedition.io.HttpConnection"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from interface javax.microedition.io.<A HREF="../../../javax/microedition/io/HttpConnection.html">HttpConnection</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/microedition/io/HttpConnection.html#GET">GET</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HEAD">HEAD</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_ACCEPTED">HTTP_ACCEPTED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_BAD_GATEWAY">HTTP_BAD_GATEWAY</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_BAD_METHOD">HTTP_BAD_METHOD</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_BAD_REQUEST">HTTP_BAD_REQUEST</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_CLIENT_TIMEOUT">HTTP_CLIENT_TIMEOUT</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_CONFLICT">HTTP_CONFLICT</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_CREATED">HTTP_CREATED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_ENTITY_TOO_LARGE">HTTP_ENTITY_TOO_LARGE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_EXPECT_FAILED">HTTP_EXPECT_FAILED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_FORBIDDEN">HTTP_FORBIDDEN</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_GATEWAY_TIMEOUT">HTTP_GATEWAY_TIMEOUT</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_GONE">HTTP_GONE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_INTERNAL_ERROR">HTTP_INTERNAL_ERROR</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_LENGTH_REQUIRED">HTTP_LENGTH_REQUIRED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_MOVED_PERM">HTTP_MOVED_PERM</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_MOVED_TEMP">HTTP_MOVED_TEMP</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_MULT_CHOICE">HTTP_MULT_CHOICE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_NO_CONTENT">HTTP_NO_CONTENT</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_NOT_ACCEPTABLE">HTTP_NOT_ACCEPTABLE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_NOT_AUTHORITATIVE">HTTP_NOT_AUTHORITATIVE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_NOT_FOUND">HTTP_NOT_FOUND</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_NOT_IMPLEMENTED">HTTP_NOT_IMPLEMENTED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_NOT_MODIFIED">HTTP_NOT_MODIFIED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_OK">HTTP_OK</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_PARTIAL">HTTP_PARTIAL</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_PAYMENT_REQUIRED">HTTP_PAYMENT_REQUIRED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_PRECON_FAILED">HTTP_PRECON_FAILED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_PROXY_AUTH">HTTP_PROXY_AUTH</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_REQ_TOO_LONG">HTTP_REQ_TOO_LONG</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_RESET">HTTP_RESET</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_SEE_OTHER">HTTP_SEE_OTHER</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_TEMP_REDIRECT">HTTP_TEMP_REDIRECT</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_UNAUTHORIZED">HTTP_UNAUTHORIZED</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_UNAVAILABLE">HTTP_UNAVAILABLE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_UNSUPPORTED_RANGE">HTTP_UNSUPPORTED_RANGE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_UNSUPPORTED_TYPE">HTTP_UNSUPPORTED_TYPE</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_USE_PROXY">HTTP_USE_PROXY</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#HTTP_VERSION">HTTP_VERSION</A>, <A HREF="../../../javax/microedition/io/HttpConnection.html#POST">POST</A></CODE></TD>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -