com.github.restdriver.serverdriver.http.response
Interface Response

All Known Implementing Classes:
DefaultResponse

public interface Response

Encapsulates a response from an HTTP server.


Method Summary
 org.codehaus.jackson.JsonNode asJson()
          Returns the JSON response content as a JsonNode, or throws RuntimeMappingException
 Element asXml()
          Returns the XML response content as an org.w3c.Element, or throws RuntimeMappingException
 String getContent()
          What was the content of the response?
 List<Header> getHeaders()
          What headers did the server send?
 long getResponseTime()
          How long did the response take?
 int getStatusCode()
          What was the response code?
 

Method Detail

getStatusCode

int getStatusCode()
What was the response code?

Returns:
the HTTP status code of the response

getContent

String getContent()
What was the content of the response?

Returns:
The response body content as a string

getHeaders

List<Header> getHeaders()
What headers did the server send?

Returns:
A list of headers

getResponseTime

long getResponseTime()
How long did the response take?

Returns:
Round-trip response time in milliseconds

asJson

org.codehaus.jackson.JsonNode asJson()
Returns the JSON response content as a JsonNode, or throws RuntimeMappingException

Returns:
The JsonNode

asXml

Element asXml()
Returns the XML response content as an org.w3c.Element, or throws RuntimeMappingException

Returns:
The Element


Copyright © 2011. All Rights Reserved.