public interface IConnection
| Modifier and Type | Method and Description |
|---|---|
void |
addRequestHeader(java.lang.String headerName,
java.lang.String headerValue)
Adds a header to the connection (Must be done before reading/writing).
|
void |
close()
Closes this connection, and all streams become inaccessible.
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders()
Gets the response headers for this connection.
|
java.io.InputStream |
getInputStream()
Gets the stream to read to the response.
|
java.io.OutputStream |
getOutputStream()
Gets the stream to write to the request.
|
java.lang.String |
getRequestMethod()
Gets the http request method.
|
int |
getResponseCode()
Gets the response code for the request.
|
java.lang.String |
getResponseMessage()
Get the response message.
|
void |
setContentLength(int length)
Set the Content-Length header
|
void |
setFollowRedirects(boolean followRedirects)
Follow 3XX series redirects.
|
void setFollowRedirects(boolean followRedirects)
followRedirects - true to follow redirects, false otherwise.void addRequestHeader(java.lang.String headerName,
java.lang.String headerValue)
headerName - The header name.headerValue - The header value.java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException - if something goes wrong while getting the stream.java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOException - if something goes wrong while getting the stream.int getResponseCode()
throws java.io.IOException
java.io.IOException - if something goes wrong while getting the response code.java.lang.String getResponseMessage()
throws java.io.IOException
java.io.IOException - if something goes wrong while getting the response message.void close()
java.util.Map<java.lang.String,java.lang.String> getHeaders()
java.lang.String getRequestMethod()
void setContentLength(int length)
length - the length of content