|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface HttpPostRequest
An object representing an HTTP POST request to be made in the future. The actual request is not made until execute() is called.
| Method Summary | |
|---|---|
void |
addFileUpload(java.lang.String name,
File file)
Add the contents of a file to the request, which will make this a multipart request and transmit the file contents as a multipart part. |
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. |
void |
addRequestParameter(java.lang.String key,
java.lang.String value)
Adds an HTTP request parameter to be included with the HTTP POST request. |
void |
addRequestParameters(NativeObject paramsNO)
Adds a set of HTTP parameters to the HTTP request. |
HttpResponse |
execute()
Executes this HTTP POST request. |
void |
setRequestBody(java.lang.String body)
Sets the raw content of the HTTP POST body. |
void |
setRequestBody(java.lang.String body,
java.lang.String contentType,
java.lang.String charSet)
Sets the raw content of the HTTP POST body. |
void |
setRequestBodyAsBase64EncodedBytes(java.lang.String bodyBase64Encoded)
Sets the raw content of the HTTP POST body using bytes represented in a standard base64 encoding. |
void |
setVerificationText(java.lang.String verificationText)
Instructs the HTTP request to look for this string of content against the response content. |
| Method Detail |
|---|
void addRequestHeader(java.lang.String key,
java.lang.String value)
key - the HTTP header key.value - the HTTP header value.void addRequestHeaders(NativeObject paramsNO)
post.addRequestHeaders({
header_one: 'some value',
header_two: ['foo', 'bar']
});
paramsNO - the JavaScript map of headers used when issuing the HTTP request.void setVerificationText(java.lang.String verificationText)
HttpResponse#isContentMatched().
verificationText - the text to check againt the returned content.
void addRequestParameter(java.lang.String key,
java.lang.String value)
key - the HTTP parameter key.value - the HTTP paramter value.void addRequestParameters(NativeObject paramsNO)
post.addRequestParameters{
param_one: 'some value',
param_two: ['foo', 'bar']
});
paramsNO - the JavaScript map of parameters used when issuing an HTTP POST.
void setRequestBody(java.lang.String body,
java.lang.String contentType,
java.lang.String charSet)
body - the body of the HTTP request.contentType - the content type of the body.charSet - the character set encoding (eg: UTF-8).void setRequestBody(java.lang.String body)
body - the body of the HTTP request.void setRequestBodyAsBase64EncodedBytes(java.lang.String bodyBase64Encoded)
bodyBase64Encoded - the body of the HTTP request in bytes encoded as a base64 string.HttpResponse execute()
void addFileUpload(java.lang.String name,
File file)
name - the request part namefile - the file to use as the content body. You can get a handle to an uploaded file using BrowserMob#getFile(String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||