public class BBWebResponse
A response to a web request, which includes a status code, a reason phrase, body, and headers.
Constructor and Description |
---|
BBWebResponse(org.apache.http.client.methods.CloseableHttpResponse response!) Constructor Generally, rather than invoking this constructor directly, you can get BBWebResponse by sending a request with BBWebClient.send() |
Modifier and Type | Method and Description |
---|---|
void | close() Explicitly closes the response once necessary information has been retrieved. |
BBjString | getBody() Text containing the information to be retrieved by the webserver. This could be an HTML web page or XML or JSON document amongst other possibilites. |
BBjVector | getHeaders() Retrieves an array of headers from the response. These headers could be information like content type, cookies, authorization tokens, etc. |
BBjString | getReasonPhrase() Text about the status code. Some webservers may give more elaborate error information than the standard status code text. |
BBjNumber | getStatusCode() The status code resulting from sending the corresponding request. I.E., 404 for "File Not Found" or "200" for "success". |
public BBWebResponse(org.apache.http.client.methods.CloseableHttpResponse response!)
Constructor Generally, rather than invoking this constructor directly, you can get BBWebResponse by sending a request with BBWebClient.send()
response!
The Apache HttpResponse object that this class wraps.public void close()
Explicitly closes the response once necessary information has been retrieved.
public BBjString getBody()
Text containing the information to be retrieved by the webserver. This could be an HTML web page or XML or JSON document amongst other possibilites.
public BBjVector getHeaders()
Retrieves an array of headers from the response. These headers could be information like content type, cookies, authorization tokens, etc.
public BBjString getReasonPhrase()
Text about the status code. Some webservers may give more elaborate error information than the standard status code text.
public BBjNumber getStatusCode()
The status code resulting from sending the corresponding request. I.E., 404 for "File Not Found" or "200" for "success".