This class represents a composition of the HTTP request parts
Modifiers | Name | Description |
---|---|---|
byte[] |
contentBytes |
(body) Binary content of the request |
java.lang.String |
contentString |
(body) String content of the request |
java.util.Map<java.lang.String, java.lang.String> |
headers |
Map of headers to be sent with this request |
groovyx.net.http.Method |
method |
Request method |
java.lang.String |
path |
Path part of this request URL |
java.util.Map<java.lang.String, java.lang.String> |
query |
Map of values that represents query parameters for this request |
groovyx.net.http.ContentType |
requestContentType |
Content type for this request |
Constructor and description |
---|
HTTPRequest
(java.util.Map args) Constructor. |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
getMethod() Accessor for the method field |
|
java.lang.String |
getPath() Accessor for the path field |
|
void |
setBinaryContent(byte[] newContent) Sets the binary content of the request. |
|
void |
setContentBytes(byte[] contentBytes) |
|
void |
setContentString(java.lang.String contentString) |
|
void |
setHeader(java.lang.String name, java.util.ArrayList<java.lang.String> values) Sets a header value |
|
void |
setHeader(java.lang.String name, java.lang.String value) Sets a header value |
|
void |
setHeaders(java.util.Map<java.lang.String, java.lang.String> headers) |
|
void |
setMethod(java.lang.String method) Sets method of this request. |
|
void |
setMethod(groovyx.net.http.Method method) |
|
void |
setPath(java.lang.String path) |
|
void |
setQuery(java.util.Map<java.lang.String, java.lang.String> query) |
|
void |
setQueryParameter(java.lang.String parameterName, java.lang.String parameterValue) Sets or removes the query parameter with given name |
|
void |
setRequestContentType(groovyx.net.http.ContentType requestContentType) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
(body) Binary content of the request
(body) String content of the request
Map of headers to be sent with this request
Request method
Path part of this request URL
Map of values that represents query parameters for this request
Content type for this request
Constructor.
args
- Map of the parameters to be filled in the requestAccessor for the method field
Accessor for the path field
Sets the binary content of the request. Request content type will be changed to binary.
newContent
- byte array that represents the content bodySets a header value
name
- name of the headervalues
- list of values, that will be concatenated in a single line, values will be separated with a semicolon.Sets a header value
name
- name of the headervalue
- value of the headerSets method of this request.
method
- String that represents Method object.
Correct values of a string are: GET, PUT, POST, DELETE, HEAD, PATCHSets or removes the query parameter with given name
parameterName
- name of the parameterparameterValue
- new value of the parameter. If it is set to null, parameter will be removed from query