Name | Arguments | Description |
---|---|---|
addCookie | cookie cookieValue | Adds a cookie cookie with value cookieValue to the connection headers. This should be called before a connection is made. If only cookie, it should be a Cookie instance. |
connect | Makes the connection to the server. Once connected, no more headers can be set. | |
getAllHeaders | Returns an array of all the header names for the HTTP response. | |
getContentBytes | lengthlimit | Returns a Java byte array of the content. If lengthlimit is <= 0, all the content is returned. |
getContentLength | Returns the "Content-Length" header of the HTTP reponse. If it is not present, -1 is returned. | |
getContentType | Returns the "Content-Type" header of the HTTP reponse. | |
getCookies | Returns an array of Cookie's from the HTTP response sent by the server. | |
getDateHeader | name | Returns a date object for the name HTTP response header. |
getDomain | Returns the domain of the URL for this connection. | |
getFileName | Returns the file name of the URL for this connection. | |
getHost | Returns the host of the URL for this connection. | |
getInputStream | Returns the input stream for this HTTP connection. This implicitly makes the connection if not connected yet. | |
getMethod | Returns the HTTP method for this connection. | |
getOutputStream | Returns the output stream for this HTTP connection. This implicitly makes the connection if not connected yet. | |
getPath | Returns the path of the URL for this connection. | |
getPort | Returns the port of the URL for this connection. | |
getQuery | Returns the query string of the URL for this connection. | |
getRef | Returns the reference of the URL for this connection. | |
getResponseMessage getResponseMsg | Returns the HTTP response message for this connection. This implicitly makes the connection if not connected yet. | |
getStatusCode getStatus | Returns the HTTP response code for this connection. This implicitly makes the connection if not connected yet. | |
getTextInput | Returns the text input (a buffered reader) for this HTTP connection. This implicitly makes the connection if not connected yet. | |
getTextOutput | Returns the text output (a print writer) for this HTTP connection. This implicitly makes the connection if not connected yet. | |
getUrl | Returns the URL for this connection. | |
loadCookies | cookiesFile | Loads all the cookies from a saved cookies file cookiesFile. If no file name specified, default to "cookies.txt". |
saveCookies | cookiesFile | Saves all the Cookie's from the HTTP response sent by the server into a file cookiesFile, or "cookies.txt" if no file name specified. |