Module org.mule.sdk.api
Interface HttpRequestBuilder
- All Superinterfaces:
HttpMessageBuilder<HttpRequestBuilder,HttpRequest>
@Experimental
@NoImplement
@MinMuleVersion("4.10.0")
public interface HttpRequestBuilder
extends HttpMessageBuilder<HttpRequestBuilder,HttpRequest>
Builder of
HttpRequests. Instances can only be obtained using HttpService.requestBuilder(). At the very least,
the request URI needs to be provided via uri(String). By default, GET is used as method with empty headers, query
params and entity.- Since:
- 0.12.0
-
Method Summary
Modifier and TypeMethodDescriptionaddQueryParam(String name, String value) Includes a new queryParam to be sent in the desiredHttpRequest.getUri()Allows for using extension methods, as defined in the rfc.method(HttpConstants.Method method) protocol(HttpProtocolVersion protocol) queryParams(org.mule.runtime.api.util.MultiMap<String, String> queryParams) Declares the URI where thisHttpRequestwill be sent.Declares the URI where thisHttpRequestwill be sent.Methods inherited from interface org.mule.sdk.api.http.domain.message.HttpMessageBuilder
addHeader, addHeaders, build, entity, getHeaders, getHeaderValue, getHeaderValues, headers, removeHeader
-
Method Details
-
uri
Declares the URI where thisHttpRequestwill be sent. Minimum required configuration.- Parameters:
uri- the URI (as a String) of theHttpRequestdesired. Non null.- Returns:
- this builder
-
uri
Declares the URI where thisHttpRequestwill be sent. Minimum required configuration.- Parameters:
uri- the URI of theHttpRequestdesired. Non null.- Returns:
- this builder
-
method
Allows for using extension methods, as defined in the rfc. In general,method(Method)should be used.- Parameters:
method- the HTTP method of theHttpRequestdesired. Non null.- Returns:
- this builder
-
method
- Parameters:
method- the HTTP method of theHttpRequestdesired. Non null.- Returns:
- this builder
-
protocol
- Parameters:
protocol- the HTTP protocol of theHttpRequestdesired. Non null.- Returns:
- this builder
-
queryParams
- Parameters:
queryParams- aMultiMaprepresenting the HTTP query params of theHttpRequestdesired. Non null.- Returns:
- this builder
-
addQueryParam
Includes a new queryParam to be sent in the desiredHttpRequest.- Parameters:
name- the name of the HTTP queryParamvalue- the value of the HTTP queryParam- Returns:
- this builder
-
getUri
URI getUri()- Returns:
- the current URI configured in the builder.
-
getMethod
String getMethod()- Returns:
- the current HTTP method configured in the builder.
-
getQueryParams
- Returns:
- an immutable version of the current query parameters in the builder.
-