public interface IResponse
Modifier and Type | Interface and Description |
---|---|
static class |
IResponse.OnHttpConnection
An implementation of the Response interface for the HttpConnection
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection
|
java.lang.String |
contentType()
Gets the Content-Type for this response.
|
java.lang.String |
getField(java.lang.String name)
Gets the named header field for this response.
|
java.io.InputStream |
openInputStream()
Opens the input stream if it has not already been opened.
|
int |
resultCode()
Returns the HTTP response status code.
|
int resultCode()
200 OK 201 Created Synchronous response 302 Found 400 Bad Request 401 Unauthorized 404 Not Found 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service UnavailableThe full definition and explanation of other status codes can be found at Hypertext Transfer Protocol -- HTTP/1.1
java.lang.String contentType()
java.lang.String getField(java.lang.String name) throws java.io.IOException
name
- header field to be examinednull
java.io.IOException
- is thrown if a network error occursjava.io.InputStream openInputStream() throws java.io.IOException
java.io.IOException
- is thrown if it has already been opened.void close() throws java.io.IOException
java.io.IOException
- if an I/O error occursCopyright © 2013, 2014, Oracle and/or its affiliates. All rights reserved.