Response
Methods Summarized
Type | Name | Summary |
---|---|---|
Get the charset of the response body. | ||
Getter for the exception message. | ||
Get the content of response as binary data. | ||
Get the content of the response as String. | ||
Gets the headers of the response as name/value arrays. | ||
Gets the headers of the response as name/value arrays. | ||
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants. | ||
Gets the status code's reason phrase. |
Methods Detailed
getCharset()
Get the charset of the response body.
Returns: String
Sample
getException()
Getter for the exception message.
Returns: String the exception message
Sample
getMediaData()
Get the content of response as binary data. It also supports gzip-ed content.
Returns: Array
Sample
getResponseBody()
Get the content of the response as String.
Returns: String
Sample
getResponseHeaders()
Gets the headers of the response as name/value arrays.
Returns: Object
Sample
getResponseHeaders(headerName)
Gets the headers of the response as name/value arrays.
Parameters
String headerName ;
Returns: Object
Sample
getStatusCode()
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.
In case there was an exception executing the request, please ignore/do not use this value (it will be 0). You can check that situation using response.getException().
Returns: Number
Sample
getStatusReasonPhrase()
Gets the status code's reason phrase. For example if a response contains status code 403 (Forbidden) it might be useful to know why.
For example a Jenkins API req. could answer with "403 No valid crumb was included in the request" which will let you know that you simply have to reques a crumb and then put that in the request headers as "Jenkins-Crumb". But you could not know that from 403 status alone...
Returns: String
Sample
Last updated