com.browsermob.api
Interface HttpGetRequest


public interface HttpGetRequest

An object representing an HTTP GET request to be made in the future. The actual request is not made until execute() is called.


Method Summary
 void addRequestHeader(java.lang.String key, java.lang.String value)
          Adds an HTTP header with the supplied key and value.
 void addRequestHeaders(NativeObject paramsNO)
          Adds a set of HTTP headers to the HTTP request.
 HttpResponse execute()
          Executes this HTTP GET request.
 void setVerificationText(java.lang.String verificationText)
          Instructs the HTTP request to look for this string of content against the response content.
 

Method Detail

addRequestHeader

void addRequestHeader(java.lang.String key,
                      java.lang.String value)
Adds an HTTP header with the supplied key and value.

Parameters:
key - the HTTP header key.
value - the HTTP header value.

addRequestHeaders

void addRequestHeaders(NativeObject paramsNO)
Adds a set of HTTP headers to the HTTP request. While the type is documented "NativeObject", this really just means that the argument can be some sort of JavaScript key/value pair. For example, a call might look like the following:

 post.addRequestHeaders({
     header_one: 'some value',
     header_two: ['foo', 'bar']
 });
 

Parameters:
paramsNO - the JavaScript map of headers used when issuing the HTTP request.

setVerificationText

void setVerificationText(java.lang.String verificationText)
Instructs the HTTP request to look for this string of content against the response content. If it is not found, a value of false will be returned by HttpResponse.isContentMatched().

Parameters:
verificationText - the text to check againt the returned content.

execute

HttpResponse execute()
Executes this HTTP GET request.

Returns:
an object that contains the detailed object results (status code, timings, etc) and whether content verification matched.


Copyright © 2009 BrowserMob LLC. All Rights Reserved.