public class Request extends Object
Modifier and Type | Field and Description |
---|---|
Map<String,File> |
filesToUpload |
boolean |
followRedirects |
Map<String,String> |
formParameters |
Map<String,String> |
headers |
String |
httpRequestType |
Object |
payload |
URI |
uri |
Modifier and Type | Method and Description |
---|---|
Request |
addFileToUpload(String param,
File fileToUpload)
Add a file to be sent as multipart form post/put.
|
Request |
addFormParameter(String key,
String value)
Add an arbitrary form parameter to this request.
|
Request |
addHeader(String key,
String value)
Add an arbitrary header to this request.
|
Request |
contentTypeApplicationJson()
Set the Content-Type header to application/json; charset=utf-8.
|
Request |
contentTypeApplicationXml()
Set the Content-Type header to application/xml; charset=utf-8.
|
static Request |
DELETE()
Get a request to perform a Http DELETE request via the TestBrowser.
|
Request |
followRedirects(boolean followRedirects)
Follow redirects automatically.
|
Request |
formParameters(Map<String,String> formParameters)
Set form parameters for this request.
|
static Request |
GET()
Get a request to perform a Http GET request via the TestBrowser.
|
static Request |
HEAD()
Get a request to perform a Http HEAD request via the TestBrowser.
|
Request |
headers(Map<String,String> headers)
Set headers for this request.
|
Request |
payload(Object payload)
Set the payload for this request.
|
String |
payloadAsPrettyString() |
static Request |
POST()
Get a request to perform a Http POST request via the TestBrowser.
|
static Request |
PUT()
Get a request to perform a Http PUT request via the TestBrowser.
|
Request |
url(URI uri)
Set the Uri of this request.
|
Request |
url(Url url)
Set the Uri of this request.
|
public String httpRequestType
public URI uri
public Object payload
public boolean followRedirects
public static Request HEAD()
public static Request GET()
public static Request POST()
public static Request PUT()
public static Request DELETE()
public Request contentTypeApplicationJson()
public Request contentTypeApplicationXml()
public Request url(Url url)
uri
- The Uri of this request.public Request url(URI uri)
uri
- The Uri of this request.public Request addFileToUpload(String param, File fileToUpload)
param
- The parameter for this file.fileToUpload
- The file to uploadpublic Request addHeader(String key, String value)
key
- The header key.value
- The header value.public Request headers(Map<String,String> headers)
headers
- A map of header keys and header values to use.public Request addFormParameter(String key, String value)
key
- The header key.value
- The header value.public Request formParameters(Map<String,String> formParameters)
formParameters
- Map of formParemter keys and values to use.public Request payload(Object payload)
payload
- The payload to use.public Request followRedirects(boolean followRedirects)
followRedirects
- Whether to follow redirects or no.public String payloadAsPrettyString()
Copyright © 2015. All Rights Reserved.