Library
Name |
HttpResponse |
Description |
An HttpResponse object contains both status information and the content
of the response to an HTTP request. |
Fields |
statusCode |
int: the HTTP status code of this response |
statusMessage |
String: a short descriptive message for the current status |
contentType |
String: the MIME type of the content, including optional character set |
contentLength |
int: the length of the content data |
|
Methods |
getContent() |
Returns the underlying InputStream for the data returned in this response |
getContentAsJSONObject() |
Parses the data as a JSON document and returns it as a JSONObject. |
getContentAsString() |
Converts and returns the response content as a String. |
getContentAsXML() |
Parses the data as an XML document and returns an XML object. |
getFirstHeaderLink() |
Returns the URL in the request header for the first page of results,
if the server supports RFC 5988 standard Link headers. |
getHeader() |
Returns an HTTP header value by key name. |
getHeaders() |
Returns an array of HTTP header values by key name. |
getLastHeaderLink() |
Returns the URL in the request header for the last page of results,
if the server supports RFC 5988 standard Link headers. |
getNextHeaderLink() |
Returns the URL in the request header for the next page of results,
if the server supports RFC 5988 standard Link headers. |
getPrevHeaderLink() |
Returns the URL in the request header for the previous page of results,
if the server supports RFC 5988 standard Link headers. |
|
Usage |
Application |
Updated on Sun Sep 03 21:52:12 PDT 2017