com.ibm.integration.admin.http
Class HttpResponse
- java.lang.Object
-
- com.ibm.integration.admin.http.HttpResponse
-
public class HttpResponse extends java.lang.ObjectParsed HttpResponse from LocalClient
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.String[]rawHttpLines
-
Constructor Summary
Constructors Constructor and Description HttpResponse(java.lang.String rawHttpResponse, java.lang.String httpVerb, java.lang.String urlPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String[]getAllHeaders()java.lang.StringgetBody()java.lang.StringgetContentLength()java.lang.StringgetError()If the server returns an error stream, then the error message will be returned by this method.java.lang.StringgetHttpVerb()get the Http verb used to get this responsejava.lang.StringgetHttpVersion()java.lang.StringgetReason()A string representing the HTTP response reason messageintgetStatusCode()An int representing the three digit HTTP response Status-Code.java.lang.StringgetUrlPath()get the URL path used to get this response<T> TparseResponseBody(java.lang.Class<T> responseClass)<T> TparseResponseBody(java.lang.String responseBody, java.lang.Class<T> responseClass)java.lang.StringtoString()
-
-
-
Constructor Detail
-
HttpResponse
public HttpResponse(java.lang.String rawHttpResponse, java.lang.String httpVerb, java.lang.String urlPath)- Parameters:
rawHttpResponse- Raw http response to be parsedhttpVerb- HTTP verb used by the request.urlPath- Uri path used by the request.
-
-
Method Detail
-
getHttpVersion
public java.lang.String getHttpVersion()
-
getStatusCode
public int getStatusCode()
An int representing the three digit HTTP response Status-Code. 1xx: Informational 2xx: Success 3xx: Redirection 4xx: Client Error 5xx: Server Error- Returns:
- statusCode
-
getReason
public java.lang.String getReason()
A string representing the HTTP response reason message- Returns:
- reasonMessage
-
getAllHeaders
public java.lang.String[] getAllHeaders()
-
getContentLength
public java.lang.String getContentLength()
-
getBody
public java.lang.String getBody()
-
getError
public java.lang.String getError()
If the server returns an error stream, then the error message will be returned by this method. If the connection was not connected, or if the server did not have an error while connecting or if the server had an error but no error data was sent, this method will return null.- Returns:
- error
-
getUrlPath
public java.lang.String getUrlPath()
get the URL path used to get this response- Returns:
- String containing the Url path
-
getHttpVerb
public java.lang.String getHttpVerb()
get the Http verb used to get this response- Returns:
- String containing the Http Verb used. For example GET
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parseResponseBody
public <T> T parseResponseBody(java.lang.String responseBody, java.lang.Class<T> responseClass) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException, IntegrationAdminException- Throws:
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionjava.io.IOExceptionIntegrationAdminException
-
parseResponseBody
public <T> T parseResponseBody(java.lang.Class<T> responseClass) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, java.io.IOException, IntegrationAdminException- Throws:
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionjava.io.IOExceptionIntegrationAdminException
-
-