Edit D:\app\Administrator\product\11.2.0\dbhome_1\owb\lib\int\HTTPClient\doc\api\HTTPClient\HTTPResponse.html
<!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 Mon May 07 18:52:25 PDT 2001 --> <TITLE> HTTPClient API: Class HTTPResponse </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 ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../HTTPClient/HttpOutputStream.html"><B>PREV CLASS</B></A> <A HREF="../HTTPClient/HttpURLConnection.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> <A HREF="HTTPResponse.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> HTTPClient</FONT> <BR> Class HTTPResponse</H2> <PRE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html">java.lang.Object</A> | +--<B>HTTPClient.HTTPResponse</B> </PRE> <HR> <DL> <DT>public class <B>HTTPResponse</B><DT>extends <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html">Object</A><DT>implements <A HREF="../HTTPClient/HTTPClientModuleConstants.html">HTTPClientModuleConstants</A></DL> <P> This defines the http-response class returned by the requests. It's basically a wrapper around the Response class which first lets all the modules handle the response before finally giving the info to the user. <P> <DL> <DT><B>Since: </B><DD>0.3</DD> <DT><B>Version: </B><DD>0.3-3 06/05/2001</DD> <DT><B>Author: </B><DD>Ronald Tschal?</DD> </DL> <HR> <P> <!-- ======== INNER CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="fields_inherited_from_class_HTTPClient.HTTPClientModuleConstants"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from interface HTTPClient.<A HREF="../HTTPClient/HTTPClientModuleConstants.html">HTTPClientModuleConstants</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_CONTINUE">REQ_CONTINUE</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_NEWCON_RST">REQ_NEWCON_RST</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_NEWCON_SND">REQ_NEWCON_SND</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_RESPONSE">REQ_RESPONSE</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_RESTART">REQ_RESTART</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_RETURN">REQ_RETURN</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#REQ_SHORTCIRC">REQ_SHORTCIRC</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_CONTINUE">RSP_CONTINUE</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_NEWCON_REQ">RSP_NEWCON_REQ</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_NEWCON_SND">RSP_NEWCON_SND</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_REQUEST">RSP_REQUEST</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_RESTART">RSP_RESTART</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_SEND">RSP_SEND</A>, <A HREF="../HTTPClient/HTTPClientModuleConstants.html#RSP_SHORTCIRC">RSP_SHORTCIRC</A></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> byte[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getData()">getData</A></B>()</CODE> <BR> Reads all the response data into a byte array.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../HTTPClient/URI.html">URI</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getEffectiveURI()">getEffectiveURI</A></B>()</CODE> <BR> Get the final URI of the document.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/net/URL.html">URL</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getEffectiveURL()">getEffectiveURL</A></B>()</CODE> <BR> <B>Deprecated.</B> <I>use getEffectiveURI() instead</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getHeader(java.lang.String)">getHeader</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr)</CODE> <BR> Retrieves the value for a given header.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Date.html">Date</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getHeaderAsDate(java.lang.String)">getHeaderAsDate</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr)</CODE> <BR> Retrieves the value for a given header.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getHeaderAsInt(java.lang.String)">getHeaderAsInt</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr)</CODE> <BR> Retrieves the value for a given header.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputStream.html">InputStream</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getInputStream()">getInputStream</A></B>()</CODE> <BR> Gets an input stream from which the returned data can be read.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../HTTPClient/URI.html">URI</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getOriginalURI()">getOriginalURI</A></B>()</CODE> <BR> Get the original URI used in the request.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getReasonLine()">getReasonLine</A></B>()</CODE> <BR> Give the reason line associated with the status code.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getServer()">getServer</A></B>()</CODE> <BR> <B>Deprecated.</B> <I>This method is a remnant of V0.1; use <code>getHeader("Server")</code> instead.</I></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getStatusCode()">getStatusCode</A></B>()</CODE> <BR> Give the status code for this request.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getText()">getText</A></B>()</CODE> <BR> Reads all the response data into a buffer and turns it into a string using the appropriate character converter.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getTrailer(java.lang.String)">getTrailer</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> trailer)</CODE> <BR> Retrieves the value for a given trailer.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Date.html">Date</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getTrailerAsDate(java.lang.String)">getTrailerAsDate</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> trailer)</CODE> <BR> Retrieves the value for a given trailer.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getTrailerAsInt(java.lang.String)">getTrailerAsInt</A></B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> trailer)</CODE> <BR> Retrieves the value for a given tailer.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#getVersion()">getVersion</A></B>()</CODE> <BR> Get the HTTP version used for the response.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#listHeaders()">listHeaders</A></B>()</CODE> <BR> Returns an enumeration of all the headers available via getHeader().</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Enumeration.html">Enumeration</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#listTrailers()">listTrailers</A></B>()</CODE> <BR> Returns an enumeration of all the trailers available via getTrailer().</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#retryRequest()">retryRequest</A></B>()</CODE> <BR> Should the request be retried by the application? If the application used an <var>HttpOutputStream</var> in the request then various modules (such as the redirection and authorization modules) are not able to resend the request themselves.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../HTTPClient/HTTPResponse.html#toString()">toString</A></B>()</CODE> <BR> produces a full list of headers and their values, one per line.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#clone()">clone</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#finalize()">finalize</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#getClass()">getClass</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#notify()">notify</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#wait()">wait</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#wait(long)">wait</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#wait(long, int)">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="getStatusCode()"><!-- --></A><H3> getStatusCode</H3> <PRE> public final int <B>getStatusCode</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Give the status code for this request. These are grouped as follows: <UL> <LI> 1xx - Informational (new in HTTP/1.1) <LI> 2xx - Success <LI> 3xx - Redirection <LI> 4xx - Client Error <LI> 5xx - Server Error </UL><DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - if any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getReasonLine()"><!-- --></A><H3> getReasonLine</H3> <PRE> public final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getReasonLine</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Give the reason line associated with the status code.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getVersion()"><!-- --></A><H3> getVersion</H3> <PRE> public final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getVersion</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Get the HTTP version used for the response.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getServer()"><!-- --></A><H3> getServer</H3> <PRE> public final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getServer</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD><B>Deprecated.</B> <I>This method is a remnant of V0.1; use <code>getHeader("Server")</code> instead.</I> <P> <DD>Get the name and type of server.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HTTPResponse.html#getHeader(java.lang.String)"><CODE>getHeader(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="getOriginalURI()"><!-- --></A><H3> getOriginalURI</H3> <PRE> public final <A HREF="../HTTPClient/URI.html">URI</A> <B>getOriginalURI</B>()</PRE> <DL> <DD>Get the original URI used in the request.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the URI used in primary request</DL> </DD> </DL> <HR> <A NAME="getEffectiveURL()"><!-- --></A><H3> getEffectiveURL</H3> <PRE> public final <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/net/URL.html">URL</A> <B>getEffectiveURL</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD><B>Deprecated.</B> <I>use getEffectiveURI() instead</I> <P> <DD>Get the final URL of the document. This is set if the original request was deferred via the "moved" (301, 302, or 303) return status.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the effective URL, or null if no redirection occured<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HTTPResponse.html#getEffectiveURI()"><CODE>getEffectiveURI()</CODE></A></DL> </DD> </DL> <HR> <A NAME="getEffectiveURI()"><!-- --></A><H3> getEffectiveURI</H3> <PRE> public final <A HREF="../HTTPClient/URI.html">URI</A> <B>getEffectiveURI</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Get the final URI of the document. If the request was redirected via the "moved" (301, 302, 303, or 307) return status this returns the URI used in the last redirection; otherwise it returns the original URI.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the effective URI<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getHeader(java.lang.String)"><!-- --></A><H3> getHeader</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getHeader</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr) throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Retrieves the value for a given header.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>hdr</CODE> - the header name.<DT><B>Returns:</B><DD>the value for the header, or null if non-existent.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getHeaderAsInt(java.lang.String)"><!-- --></A><H3> getHeaderAsInt</H3> <PRE> public int <B>getHeaderAsInt</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr) throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/NumberFormatException.html">NumberFormatException</A></PRE> <DL> <DD>Retrieves the value for a given header. The value is parsed as an int.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>hdr</CODE> - the header name.<DT><B>Returns:</B><DD>the value for the header if the header exists<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/NumberFormatException.html">NumberFormatException</A> - if the header's value is not a number or if the header does not exist.<DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - if any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getHeaderAsDate(java.lang.String)"><!-- --></A><H3> getHeaderAsDate</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Date.html">Date</A> <B>getHeaderAsDate</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> hdr) throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/IllegalArgumentException.html">IllegalArgumentException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Retrieves the value for a given header. The value is parsed as a date; if this fails it is parsed as a long representing the number of seconds since 12:00 AM, Jan 1st, 1970. If this also fails an exception is thrown. <br>Note: When sending dates use Util.httpDate().<DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>hdr</CODE> - the header name.<DT><B>Returns:</B><DD>the value for the header, or null if non-existent.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/IllegalArgumentException.html">IllegalArgumentException</A> - if the header's value is neither a legal date nor a number.<DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - if any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="listHeaders()"><!-- --></A><H3> listHeaders</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Enumeration.html">Enumeration</A> <B>listHeaders</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Returns an enumeration of all the headers available via getHeader().<DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getTrailer(java.lang.String)"><!-- --></A><H3> getTrailer</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getTrailer</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> trailer) throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Retrieves the value for a given trailer. This should not be invoked until all response data has been read. If invoked before it will call <code>getData()</code> to force the data to be read.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>trailer</CODE> - the trailer name.<DT><B>Returns:</B><DD>the value for the trailer, or null if non-existent.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HTTPResponse.html#getData()"><CODE>getData()</CODE></A></DL> </DD> </DL> <HR> <A NAME="getTrailerAsInt(java.lang.String)"><!-- --></A><H3> getTrailerAsInt</H3> <PRE> public int <B>getTrailerAsInt</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> trailer) throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/NumberFormatException.html">NumberFormatException</A></PRE> <DL> <DD>Retrieves the value for a given tailer. The value is parsed as an int.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>trailer</CODE> - the tailer name.<DT><B>Returns:</B><DD>the value for the trailer if the trailer exists<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/NumberFormatException.html">NumberFormatException</A> - if the trailer's value is not a number or if the trailer does not exist.<DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - if any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getTrailerAsDate(java.lang.String)"><!-- --></A><H3> getTrailerAsDate</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Date.html">Date</A> <B>getTrailerAsDate</B>(<A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> trailer) throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/IllegalArgumentException.html">IllegalArgumentException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Retrieves the value for a given trailer. The value is parsed as a date; if this fails it is parsed as a long representing the number of seconds since 12:00 AM, Jan 1st, 1970. If this also fails an IllegalArgumentException is thrown. <br>Note: When sending dates use Util.httpDate().<DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>trailer</CODE> - the trailer name.<DT><B>Returns:</B><DD>the value for the trailer, or null if non-existent.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/IllegalArgumentException.html">IllegalArgumentException</A> - if the trailer's value is neither a legal date nor a number.<DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - if any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="listTrailers()"><!-- --></A><H3> listTrailers</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/util/Enumeration.html">Enumeration</A> <B>listTrailers</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Returns an enumeration of all the trailers available via getTrailer().<DD><DL> </DL> </DD> <DD><DL> <DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="getData()"><!-- --></A><H3> getData</H3> <PRE> public byte[] <B>getData</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Reads all the response data into a byte array. Note that this method won't return until <em>all</em> the data has been received (so for instance don't invoke this method if the server is doing a server push). If <code>getInputStream()</code> had been previously invoked then this method only returns any unread data remaining on the stream and then closes it. <P>Note to the unwary: code like <PRE> System.out.println("The data: " + resp.getData()) </PRE> will probably not do what you want - use <PRE> System.out.println("The data: " + resp.getText()) </PRE> instead.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>an array containing the data (body) returned. If no data was returned then it's set to a zero-length array.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any io exception occured while reading the data<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HTTPResponse.html#getInputStream()"><CODE>getInputStream()</CODE></A></DL> </DD> </DL> <HR> <A NAME="getText()"><!-- --></A><H3> getText</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>getText</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A>, <A HREF="../HTTPClient/ParseException.html">ParseException</A></PRE> <DL> <DD>Reads all the response data into a buffer and turns it into a string using the appropriate character converter. Since this uses <A HREF="../HTTPClient/HTTPResponse.html#getData()"><CODE>getData()</CODE></A>, the caveats of that method apply here as well.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the body as a String. If no data was returned then an empty string is returned.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any io exception occured while reading the data, or if the content is not text<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.<DD><A HREF="../HTTPClient/ParseException.html">ParseException</A> - if an error occured trying to parse the content-type header field<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HTTPResponse.html#getData()"><CODE>getData()</CODE></A></DL> </DD> </DL> <HR> <A NAME="getInputStream()"><!-- --></A><H3> getInputStream</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/InputStream.html">InputStream</A> <B>getInputStream</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Gets an input stream from which the returned data can be read. Note that if <code>getData()</code> had been previously invoked it will actually return a ByteArrayInputStream created from that data.<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the InputStream.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.<DT><B>See Also: </B><DD><A HREF="../HTTPClient/HTTPResponse.html#getData()"><CODE>getData()</CODE></A></DL> </DD> </DL> <HR> <A NAME="retryRequest()"><!-- --></A><H3> retryRequest</H3> <PRE> public boolean <B>retryRequest</B>() throws <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A>, <A HREF="../HTTPClient/ModuleException.html">ModuleException</A></PRE> <DL> <DD>Should the request be retried by the application? If the application used an <var>HttpOutputStream</var> in the request then various modules (such as the redirection and authorization modules) are not able to resend the request themselves. Instead, it becomes the application's responsibility. The application can check this flag, and if it's set, resend the exact same request. The modules such as the RedirectionModule or AuthorizationModule will then recognize the resend and fix up or redirect the request as required (i.e. they defer their normal action until the resend). <P>If the application resends the request then it <strong>must</strong> use the same <var>HttpOutputStream</var> instance. This is because the modules use this to recognize the retried request and to perform the necessary work on the request before it's sent. <P>Here is a skeleton example of usage: <PRE> OutputStream out = new HttpOutputStream(1234); do { rsp = con.Post("/cgi-bin/my_cgi", out); out.write(...); out.close(); } while (rsp.retryRequest()); if (rsp.getStatusCode() >= 300) ... </PRE> <P>Note that for this to ever return true, the java system property <var>HTTPClient.deferStreamed</var> must be set to true at the beginning of the application (before the HTTPConnection class is loaded). This prevents unwary applications from causing inadvertent memory leaks. If an application does set this, then it <em>must</em> resend any request whose response returns true here in order to prevent memory leaks (a switch to JDK 1.2 will allow us to use weak references and eliminate this problem).<DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>true if the request should be retried.<DT><B>Throws:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/io/IOException.html">IOException</A> - If any exception occurs on the socket.<DD><A HREF="../HTTPClient/ModuleException.html">ModuleException</A> - if any module encounters an exception.</DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/String.html">String</A> <B>toString</B>()</PRE> <DL> <DD>produces a full list of headers and their values, one per line.<DD><DL> <DT><B>Overrides:</B><DD><A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html#toString()">toString</A> in class <A HREF="http://java.sun.com/products/jdk/1.2/docs/api/java/lang/Object.html">Object</A></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>a string containing the headers</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_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 ID="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../HTTPClient/HttpOutputStream.html"><B>PREV CLASS</B></A> <A HREF="../HTTPClient/HttpURLConnection.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> <A HREF="HTTPResponse.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> </BODY> </HTML>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de