Package org.spincast.plugins.httpclient
Interface HttpRequestBuilder<T extends HttpRequestBuilder<?>>
- All Known Subinterfaces:
BodySenderRequestBuilderBase<T>
,ConnectRequestBuilder
,DeleteRequestBuilder
,GetRequestBuilder
,HeadRequestBuilder
,OptionsRequestBuilder
,PatchRequestBuilder
,PostRequestBuilder
,PutRequestBuilder
,TraceRequestBuilder
,WebsocketRequestBuilder
- All Known Implementing Classes:
BodySenderRequestBuilderBaseDefault
,ConnectRequestBuilderDefault
,DeleteRequestBuilderDefault
,GetRequestBuilderDefault
,HeadRequestBuilderDefault
,HttpRequestBuilderBase
,HttpSpincastRequestBuilderBase
,OptionsRequestBuilderDefault
,PatchRequestBuilderDefault
,PostRequestBuilderDefault
,PutRequestBuilderDefault
,TraceRequestBuilderDefault
,WebsocketRequestBuilderDefault
public interface HttpRequestBuilder<T extends HttpRequestBuilder<?>>
Base for all Http/Websocket request builders.
-
Method Summary
Modifier and TypeMethodDescriptionaddHeaderValue
(String key, String value) Adds a value to the specified header.addHeaderValues
(String key, List<String> values) Adds some values to the specified header.Adds anAccept
head forHTML
.Adds anAccept
head forJson
.Adds anAccept
head forplain text
.Adds anAccept
head forXML
.Disables automatic handling of redirects.Disables someSSL
certificates errors (such as self-signed certificate errors).send()
Sends the request and gets the HTTP response.Sets a cookie.Sets a cookie, secure or not.Sets a cookie.setCookies
(Collection<Cookie> cookies) Sets some cookies.setHeaders
(Map<String, List<String>> headers) Sets the headers.setHeaderValues
(String key, List<String> values) Sets the values of the specified header.setHttpAuthCredentials
(String username, String password) Set HTTP authentication credentials.setHttpClientBuilder
(org.spincast.shaded.org.apache.http.impl.client.HttpClientBuilder httpClientBuilder) Sets a specificHttpClientBuilder
to use.setRequestConfig
(org.spincast.shaded.org.apache.http.client.config.RequestConfig requestConfig) Sets a customRequestConfig
to use.
-
Method Details
-
addHeaderValue
Adds a value to the specified header. Existing values will be kept. -
addHeaderValues
Adds some values to the specified header. Existing values will be kept. -
setHeaders
Sets the headers. Existing headers will be overwritten. -
setHeaderValues
Sets the values of the specified header. Existing values of this header will be overwritten. -
addJsonAcceptHeader
T addJsonAcceptHeader()Adds anAccept
head forJson
. -
addXMLAcceptHeader
T addXMLAcceptHeader()Adds anAccept
head forXML
. -
addHTMLAcceptHeader
T addHTMLAcceptHeader()Adds anAccept
head forHTML
. -
addPlainTextAcceptHeader
T addPlainTextAcceptHeader()Adds anAccept
head forplain text
. -
setCookie
Sets a cookie. Secure by default (HTTPS only)! -
setCookie
Sets a cookie, secure or not. -
setCookie
Sets a cookie. -
setCookies
Sets some cookies. -
setRequestConfig
Sets a customRequestConfig
to use. If not provided, a default one will be used. -
setHttpClientBuilder
T setHttpClientBuilder(org.spincast.shaded.org.apache.http.impl.client.HttpClientBuilder httpClientBuilder) Sets a specificHttpClientBuilder
to use. If not provided, a default one will be used. -
disableSslCertificateErrors
T disableSslCertificateErrors()Disables someSSL
certificates errors (such as self-signed certificate errors).SSL
certificate errors are not disabled by default.Be sure you know what you are doing if you disable this! It may lead to some security concerns!
-
disableRedirectHandling
T disableRedirectHandling()Disables automatic handling of redirects.By default, the client will automatically follow a redirect response. Calling this will allow you to get the actual redirect HTTP status.
-
setHttpAuthCredentials
Set HTTP authentication credentials. -
send
HttpResponse send()Sends the request and gets the HTTP response.
-