Represents the HTTP request to be customized
Modifiers | Name | Description |
---|---|---|
static class |
HttpRequestBuilder.FormDataBuilder |
|
static class |
HttpRequestBuilder.MultipartBuilder |
Helps with building multipart requests |
Constructor and description |
---|
HttpRequestBuilder
(io.netty.handler.codec.http.FullHttpRequest request, java.lang.String encoding) |
HttpRequestBuilder
(io.netty.handler.codec.http.FullHttpRequest request, java.nio.charset.Charset charset) |
Type | Name and description |
---|---|
HttpRequestBuilder |
accept(java.lang.CharSequence... contentTypes) Sets the Accept HTTP header to the given value. |
HttpRequestBuilder |
auth(java.lang.String username, java.lang.String password) Used to configure BASIC authentication. |
HttpRequestBuilder |
auth(java.lang.CharSequence accessToken) Sets the Authorization HTTP header to the given value. |
HttpRequestBuilder |
form(groovy.lang.Closure formDefinition) Builds a form |
HttpRequestBuilder |
method(java.lang.CharSequence method) Sets the method of the request |
HttpRequestBuilder |
multipart(groovy.lang.Closure formDefinition) Builds a multipart form |
HttpRequestBuilder |
uri(java.lang.CharSequence uri) Sets the URI of the request |
Methods inherited from class | Name |
---|---|
class HttpMessageBuilder |
contentType, defaultContentType, defaultJsonContentType, header, json, json, json, json, prepareJsonBuilder, xml, xml, xml |
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() |
Sets the Accept HTTP header to the given value. Example:
restBuilder.get("http://..") {
accept "application/xml"
}
contentTypes
- The content typesUsed to configure BASIC authentication. Example:
builder.put("http://..") {
auth "myuser", "mypassword"
}
username
- The usernamepassword
- The passwordSets the Authorization HTTP header to the given value. Used typically to pass OAuth access tokens.
builder.put("http://..") {
auth myToken
}
accessToken
- The access tokenBuilds a form
formDefinition
- The form definitionSets the method of the request
method
- The HTTP methodBuilds a multipart form
formDefinition
- The form definitionSets the URI of the request
uri
- The uriTemplate of the request