com.browsermob.api
Interface HttpResponse


public interface HttpResponse

The result of an HTTP request in a Virtual User (VU) script. This object contains the actual data that will be stored in the transaction (see getInfo()) as well as the result for any content verification (if one was provided when the request was made).


Method Summary
 java.lang.String getBody()
          Returns the response body if and only if the corresponding request asked for text validation to occurr.
 java.lang.String getCharSet()
          Returns the response character set if and only if the corresponding request asked for text validation to occurr.
 java.lang.String getContentType()
          Returns the response content type if and only if the corresponding request asked for text validation to occurr.
 java.lang.String getErrorMessage()
          Returns descriptive text of any error that occurred while making the HTTP request.
 java.lang.String getHeader(java.lang.String name)
          Returns the value of the specific response header, or null if no header exists in the response.
 TransactionStepObject getInfo()
          Returns the actual information that will be stored in to the core data collected as part of the overall transaction.
 boolean isContentMatched()
          Returns true if the content was verified to be in the resulting HTTP response.
 

Method Detail

isContentMatched

boolean isContentMatched()
Returns true if the content was verified to be in the resulting HTTP response. If no content verification was requested, this function returns true regardless.

Returns:
true if the content was verified in the HTTP request.

getInfo

TransactionStepObject getInfo()
Returns the actual information that will be stored in to the core data collected as part of the overall transaction.

Returns:
the information associated with the HTTP request, such as bytes transferred and HTTP response code.

getBody

java.lang.String getBody()
Returns the response body if and only if the corresponding request asked for text validation to occurr. Otherwise, null is returned.

Returns:
true the body of the HTTP response.

getCharSet

java.lang.String getCharSet()
Returns the response character set if and only if the corresponding request asked for text validation to occurr. Otherwise, null is returned.

Returns:
true the character set encoding of the HTTP response.

getContentType

java.lang.String getContentType()
Returns the response content type if and only if the corresponding request asked for text validation to occurr. Otherwise, null is returned.

Returns:
true the content type of the HTTP response.

getErrorMessage

java.lang.String getErrorMessage()
Returns descriptive text of any error that occurred while making the HTTP request. This message is usually coupled with an HTTP status code of -999 or -998, which is a BrowserMob-specific indicator that the request could not complete, usually due to some I/O exception. This error message can usually shed light on what the I/O issue was and is suitable to be thrown as an exception within the underlying script that made the HTTP request.

Returns:
the string error message or null if no error occurred or no message can be found.

getHeader

java.lang.String getHeader(java.lang.String name)
Returns the value of the specific response header, or null if no header exists in the response.

Parameters:
name - the header name
Returns:
the value of the response header, or null if the header did not exist.


Copyright © 2009 BrowserMob LLC. All Rights Reserved.