public.javadoc.org.spincast.plugins.httpclient.HttpRequestBuilder.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
HttpRequestBuilder (org.spincast:spincast-framework 1.13.0 API)
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
All Methods Instance Methods Abstract Methods
Modifier and Type
Method and Description
T
addHeaderValue(String key,
String value)
Adds a value to the specified header.
T
addHeaderValues(String key,
List<String> values)
Adds some values to the specified header.
T
addHTMLAcceptHeader()
Adds an Accept
head for HTML
.
T
addJsonAcceptHeader()
Adds an Accept
head for Json
.
T
addPlainTextAcceptHeader()
Adds an Accept
head for plain text
.
T
addXMLAcceptHeader()
Adds an Accept
head for XML
.
T
disableRedirectHandling()
Disables automatic handling of redirects.
T
disableSslCertificateErrors()
Disables some SSL
certificates errors (such as self-signed
certificate errors).
HttpResponse
send()
Sends the request and gets the HTTP response.
T
setCookie(Cookie cookie)
Sets a cookie.
T
setCookie(String name,
String value)
Sets a cookie.
T
setCookie(String name,
String value,
boolean secure)
Sets a cookie, secure or not.
T
setCookies(Collection<Cookie> cookies)
Sets some cookies.
T
setHeaders(Map<String,List<String>> headers)
Sets the headers.
T
setHeaderValues(String key,
List<String> values)
Sets the values of the specified header.
T
setHttpAuthCredentials(String username,
String password)
Set HTTP authentication credentials.
T
setHttpClientBuilder(org.spincast.shaded.org.apache.http.impl.client.HttpClientBuilder httpClientBuilder)
Sets a specific HttpClientBuilder
to use.
T
setRequestConfig(org.spincast.shaded.org.apache.http.client.config.RequestConfig requestConfig)
Sets a custom RequestConfig
to use.
-
-
Method Detail
-
addHeaderValue
T addHeaderValue(String key,
String value)
Adds a value to the specified header. Existing values will
be kept.
-
addHeaderValues
T addHeaderValues(String key,
List<String> values)
Adds some values to the specified header. Existing values will
be kept.
-
setHeaders
T setHeaders(Map<String,List<String>> headers)
Sets the headers. Existing headers will be overwritten.
-
setHeaderValues
T setHeaderValues(String key,
List<String> values)
Sets the values of the specified header. Existing values
of this header will be overwritten.
-
addJsonAcceptHeader
T addJsonAcceptHeader()
Adds an Accept
head for Json
.
-
addXMLAcceptHeader
T addXMLAcceptHeader()
Adds an Accept
head for XML
.
-
addHTMLAcceptHeader
T addHTMLAcceptHeader()
Adds an Accept
head for HTML
.
-
addPlainTextAcceptHeader
T addPlainTextAcceptHeader()
Adds an Accept
head for plain text
.
-
setCookies
T setCookies(Collection<Cookie> cookies)
Sets some cookies.
-
setRequestConfig
T setRequestConfig(org.spincast.shaded.org.apache.http.client.config.RequestConfig requestConfig)
Sets a custom RequestConfig
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 specific HttpClientBuilder
to use. If not provided,
a default one will be used.
-
disableSslCertificateErrors
T disableSslCertificateErrors()
Disables some SSL
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
T setHttpAuthCredentials(String username,
String password)
Set HTTP authentication credentials.
-
send
HttpResponse send()
Sends the request and gets the HTTP response.
Copyright © 2019. All rights reserved.