public class HttpRequestWithBody extends HttpRequest
By default, parameters are case insensitive and may not be null or empty unless otherwise specified.
bodyEntityconnection, httpRequest| Modifier and Type | Method and Description |
|---|---|
HttpRequestWithBody |
body(java.lang.String body)
Returns this object after setting the body as a String.
|
HttpRequestWithBody |
header(java.lang.String name,
java.lang.String value)
Returns this request after setting the specified header.
|
HttpRequestWithBody |
headers(java.util.Map<java.lang.String,java.lang.String> headerMap)
Returns this request after setting the specified headers.
|
HttpRequestWithBody |
pathParam(java.lang.String name,
java.lang.String value)
Returns this request after setting the sepcified dynamic parameter
value in the URL.
|
HttpRequestWithBody |
queryParam(java.util.Map<java.lang.String,?> parameters)
Returns this request after setting the specified query parameters.
|
HttpRequestWithBody |
queryParam(java.lang.String name,
java.lang.Object value)
Returns this request after setting the specified query parameter.
|
getAccessToken, getBodyEntity, getHeaders, getHttpMethod, getPassword, getQueryParams, getUrl, getUserName, isLocalHost, queryParam, queryParamsasString, getHttpRequest, getHttpRequestpublic HttpRequestWithBody body(java.lang.String body)
body - body as Stringpublic HttpRequestWithBody header(java.lang.String name, java.lang.String value)
The request headers will be merged into the default headers configured/saved with the connection. The request header will win if a header with the same name exists in both the default and the request headers.
header in class HttpRequestname - name of the headervalue - value for the headerpublic HttpRequestWithBody headers(java.util.Map<java.lang.String,java.lang.String> headerMap)
This method can be called to set multiple request headers at once.
The request headers will be merged into the default headers configured/saved with the connection. The request header will win if a header with the same name exists in both the default and the request headers.
headers in class HttpRequestheaderMap - map of headers and the correponding valuespublic HttpRequestWithBody pathParam(java.lang.String name, java.lang.String value)
This method can be called to set the value for dynamic parameters if there are placeholders in the URL configured in the connection.
pathParam in class HttpRequestname - name of the dynamic parametervalue - value for dynamic parameterpublic HttpRequestWithBody queryParam(java.util.Map<java.lang.String,?> parameters)
This method can be called to set multiple query parameters at once.
The query parameters will be merged into the default query parameters configured/saved with the connection. The request query parameters will win if a query parameters with the same name exists in both the default and the request query parameters.
This method has been deprecated and replaced by
HttpRequest.queryParams(Map)
queryParam in class HttpRequestparameters - map of query parameters and the correponding valuespublic HttpRequestWithBody queryParam(java.lang.String name, java.lang.Object value)
The query parameter will be merged into the default query parameters configured/saved with the connection. The request query parameters will win if a query parameters with the same name exists in both the default and the request query parameters.
queryParam in class HttpRequestname - name of the query parametervalue - value for the query parameterCopyright © 2017, 2025, Oracle and/or its affiliates. All rights reserved.