com.ibm.integration.admin.http
Class HttpResponse
- java.lang.Object
-
- com.ibm.integration.admin.http.HttpResponse
-
public class HttpResponse extends java.lang.Object
Parsed 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.String
getBody()
java.lang.String
getContentLength()
java.lang.String
getError()
If the server returns an error stream, then the error message will be returned by this method.java.lang.String
getHttpVerb()
get the Http verb used to get this responsejava.lang.String
getHttpVersion()
java.lang.String
getReason()
A string representing the HTTP response reason messageint
getStatusCode()
An int representing the three digit HTTP response Status-Code.java.lang.String
getUrlPath()
get the URL path used to get this response<T> T
parseResponseBody(java.lang.Class<T> responseClass)
<T> T
parseResponseBody(java.lang.String responseBody, java.lang.Class<T> responseClass)
java.lang.String
toString()
-
-
-
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:
toString
in 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.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
java.io.IOException
IntegrationAdminException
-
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.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
java.io.IOException
IntegrationAdminException
-
-