Class HttpClientRequest.Builder
java.lang.Object
org.mule.weave.v2.module.http.service.HttpClientRequest.Builder
- Enclosing class:
- HttpClientRequest
Builder of
HttpClientRequests.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIncludes a new header to be sent in the desiredHttpClientRequest.Includes a new header to be sent in the desiredHttpClientRequest.addHeaders(String name, List<String> values) Includes a new header with multiple values to be sent in the desiredHttpClientRequest.addQueryParam(String name, String value) Includes a new queryParam to be sent in the desiredHttpClientRequest.addQueryParam(HttpClientQueryParams.HttpQueryParam queryParam) Includes a new queryParam to be sent in the desiredHttpClientRequest.build()Creates an instance ofHttpClientRequest.setBody(InputStream body) Includes the HTTP entity that should be used sent in the desiredHttpClientRequest.setEnableMetrics(boolean enableMetrics) Set the HTTP request enableMetrics of theHttpClientRequestdesired.setFollowRedirect(boolean followRedirects) IfHttpClientRequestis to follow redirects.Set the HTTP method of theHttpClientRequestdesired.setReadTimeout(int readTimeout) Set the HTTP request timeout of theHttpClientRequestdesired.setRequestTimeout(int requestTimeout) Set the HTTP request timeout of theHttpClientRequestdesired.setStreamResponse(boolean streamResponse) Set the HTTP request streamingResponse of theHttpClientRequestdesired.Declares the url where thisHttpClientRequestwill be sent.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setUrl
Declares the url where thisHttpClientRequestwill be sent. Required configuration.- Parameters:
url- the url of theHttpClientRequestdesired.- Returns:
- this builder.
-
setMethod
Set the HTTP method of theHttpClientRequestdesired.- Parameters:
method- the HTTP method of theHttpClientRequestdesired. Not null.- Returns:
- this builder.
-
addHeader
Includes a new header to be sent in the desiredHttpClientRequest.- Parameters:
name- the name of the HTTP header.value- the value of the HTTP header.- Returns:
- this builder.
-
addHeader
Includes a new header to be sent in the desiredHttpClientRequest.- Parameters:
header- theHttpClientHeaders.HttpHeaderthat should be used. Not null.- Returns:
- this builder.
-
addHeaders
Includes a new header with multiple values to be sent in the desiredHttpClientRequest.- Parameters:
name- the name of the HTTP header.values- the values of the HTTP header.- Returns:
- this builder.
-
addQueryParam
Includes a new queryParam to be sent in the desiredHttpClientRequest.- Parameters:
name- the name of the HTTP queryParam.value- the value of the HTTP queryParam.- Returns:
- this builder.
-
addQueryParam
Includes a new queryParam to be sent in the desiredHttpClientRequest.- Parameters:
queryParam- theHttpClientQueryParams.HttpQueryParamthat should be used. Not null.- Returns:
- this builder.
-
setBody
Includes the HTTP entity that should be used sent in the desiredHttpClientRequest.- Parameters:
body- theInputStreamthat should be used as body for theHttpClientRequest. Not null.- Returns:
- this builder
-
setFollowRedirect
IfHttpClientRequestis to follow redirects.- Parameters:
followRedirects- if this request is to follow redirects.- Returns:
- this builder.
-
setReadTimeout
Set the HTTP request timeout of theHttpClientRequestdesired.- Parameters:
readTimeout- the read timeout.- Returns:
- this builder.
-
setRequestTimeout
Set the HTTP request timeout of theHttpClientRequestdesired.- Parameters:
requestTimeout- the request timeout.- Returns:
- this builder.
-
setStreamResponse
Set the HTTP request streamingResponse of theHttpClientRequestdesired.- Parameters:
streamResponse- if this request response should be streamed.- Returns:
- this builder.
-
setEnableMetrics
Set the HTTP request enableMetrics of theHttpClientRequestdesired.- Parameters:
enableMetrics- if this request response should be measured.- Returns:
- this builder.
-
build
Creates an instance ofHttpClientRequest.- Returns:
- an
HttpClientRequestas described.
-