Uses of Class
org.springframework.http.HttpHeaders
Packages that use HttpHeaders
Package
Description
Contains a basic abstraction over client/server-side HTTP.
Contains an abstraction over client-side HTTP.
Abstractions for reactive HTTP client support including
ClientHttpRequest and
ClientHttpResponse as well as a
ClientHttpConnector.This package provides generic HTTP support classes,
to be used by higher-level classes like RestTemplate.
Multipart support.
Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.
Provides HttpMessageConverter implementations for handling JSON.
Provides HttpMessageConverter implementations for handling XML.
Contains an abstraction over server-side HTTP.
Abstractions for reactive HTTP server support including a
ServerHttpRequest and
ServerHttpResponse along with an
HttpHandler for processing.Common, generic interfaces that define minimal boundary points
between Spring's web infrastructure and other framework modules.
Core package of the client-side web support.
Classes supporting the
org.springframework.web.client package.Multipart resolution framework for handling file uploads.
Support classes for the multipart resolution framework.
Core interfaces and classes for Spring's generic, reactive web support.
Support for creating a client proxy for an HTTP service annotated with
HttpExchange methods.Miscellaneous web utility classes, such as HTML escaping and cookie handling.
-
Uses of HttpHeaders in org.springframework.http
Fields in org.springframework.http declared as HttpHeadersModifier and TypeFieldDescriptionstatic final HttpHeadersHttpHeaders.EMPTYAn emptyHttpHeadersinstance (immutable).Methods in org.springframework.http that return HttpHeadersModifier and TypeMethodDescriptionstatic HttpHeadersHttpHeaders.copyOf(HttpHeaders httpHeaders) Create a new, mutableHttpHeadersinstance and copy the supplied headers to that new instance.static HttpHeadersCreate a new, mutableHttpHeadersinstance and copy the supplied headers to that new instance.HttpEntity.getHeaders()Returns the headers of this entity.HttpMessage.getHeaders()Return the headers of this message.static HttpHeadersHttpHeaders.readOnlyHttpHeaders(HttpHeaders headers) Apply a read-onlyHttpHeaderswrapper around the given headers, if necessary.static HttpHeadersHttpHeaders.readOnlyHttpHeaders(org.springframework.util.MultiValueMap<String, String> headers) Apply a read-onlyHttpHeaderswrapper around the given headers, if necessary.Methods in org.springframework.http with parameters of type HttpHeadersModifier and TypeMethodDescriptionvoidHttpHeaders.addAll(HttpHeaders headers) Add all name-value pairs of the givenHttpHeaders.static HttpHeadersHttpHeaders.copyOf(HttpHeaders httpHeaders) Create a new, mutableHttpHeadersinstance and copy the supplied headers to that new instance.RequestEntity.HeadersBuilder.headers(@Nullable HttpHeaders headers) Copy the given headers into the entity's headers map.ResponseEntity.HeadersBuilder.headers(@Nullable HttpHeaders headers) Copy the given headers into the entity's headers map.voidHttpHeaders.putAll(HttpHeaders headers) Put all the entries from the given HttpHeaders into this HttpHeaders.static HttpHeadersHttpHeaders.readOnlyHttpHeaders(HttpHeaders headers) Apply a read-onlyHttpHeaderswrapper around the given headers, if necessary.Method parameters in org.springframework.http with type arguments of type HttpHeadersModifier and TypeMethodDescriptionRequestEntity.HeadersBuilder.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this entity's headers with the given consumer.ResponseEntity.HeadersBuilder.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this entity's headers with the given consumer.Constructors in org.springframework.http with parameters of type HttpHeadersModifierConstructorDescriptionHttpEntity(@Nullable T body, @Nullable HttpHeaders headers) Create a newHttpEntitywith the given body and headers.HttpEntity(HttpHeaders headers) Create a newHttpEntitywith the given headers and no body.HttpHeaders(HttpHeaders httpHeaders) Construct a newHttpHeadersinstance backed by the suppliedHttpHeaders.RequestEntity(@Nullable T body, @Nullable HttpHeaders headers, @Nullable HttpMethod method, @Nullable URI url, @Nullable Type type) Constructor with method, URL, headers, body and type.RequestEntity(@Nullable T body, @Nullable HttpHeaders headers, @Nullable HttpMethod method, URI url) Constructor with method, URL, headers and body.RequestEntity(HttpHeaders headers, HttpMethod method, URI url) Constructor with method, URL and headers but without body.ResponseEntity(@Nullable T body, @Nullable HttpHeaders headers, int rawStatus) Create aResponseEntitywith a body, headers, and a raw status code.ResponseEntity(@Nullable T body, @Nullable HttpHeaders headers, HttpStatusCode statusCode) Create aResponseEntitywith a body, headers, and a status code.ResponseEntity(HttpHeaders headers, HttpStatusCode status) Create aResponseEntitywith headers and a status code. -
Uses of HttpHeaders in org.springframework.http.client
Methods in org.springframework.http.client that return HttpHeadersMethods in org.springframework.http.client with parameters of type HttpHeadersModifier and TypeMethodDescriptionprotected abstract ClientHttpResponseAbstractClientHttpRequest.executeInternal(HttpHeaders headers) Abstract template method that writes the given headers and content to the HTTP request.protected abstract OutputStreamAbstractClientHttpRequest.getBodyInternal(HttpHeaders headers) Abstract template method that returns the body.Method parameters in org.springframework.http.client with type arguments of type HttpHeadersModifier and TypeMethodDescriptionMultipartBodyBuilder.PartBuilder.headers(Consumer<HttpHeaders> headersConsumer) Manipulate the part headers through the given consumer. -
Uses of HttpHeaders in org.springframework.http.client.reactive
Methods in org.springframework.http.client.reactive that return HttpHeadersModifier and TypeMethodDescriptionAbstractClientHttpRequest.getHeaders()AbstractClientHttpResponse.getHeaders()ClientHttpRequestDecorator.getHeaders()ClientHttpResponseDecorator.getHeaders()protected HttpHeadersAbstractClientHttpRequest.initReadOnlyHeaders()Initialize the read-only headers after the request is committed.Constructors in org.springframework.http.client.reactive with parameters of type HttpHeadersModifierConstructorDescriptionAbstractClientHttpRequest(HttpHeaders headers) protectedAbstractClientHttpResponse(HttpStatusCode statusCode, HttpHeaders headers, org.springframework.util.MultiValueMap<String, ResponseCookie> cookies, reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> body) -
Uses of HttpHeaders in org.springframework.http.client.support
Methods in org.springframework.http.client.support that return HttpHeadersModifier and TypeMethodDescriptionHttpRequestWrapper.getHeaders()Return the headers of the wrapped request. -
Uses of HttpHeaders in org.springframework.http.codec.multipart
Methods in org.springframework.http.codec.multipart that return HttpHeadersModifier and TypeMethodDescriptionPart.headers()Return the headers associated with the part.PartEvent.headers()Return the headers of the part that this event belongs to.Methods in org.springframework.http.codec.multipart with parameters of type HttpHeadersModifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<org.springframework.core.io.buffer.DataBuffer> MultipartWriterSupport.generatePartHeaders(HttpHeaders headers, org.springframework.core.io.buffer.DataBufferFactory bufferFactory) Method parameters in org.springframework.http.codec.multipart with type arguments of type HttpHeadersModifier and TypeMethodDescriptionstatic reactor.core.publisher.Flux<FilePartEvent> FilePartEvent.create(String partName, String filename, MediaType contentType, reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> contents, @Nullable Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name, FilePartEvent.filename(), content-type, and contents.static reactor.core.publisher.Flux<FilePartEvent> Creates a stream ofFilePartEventobjects based on the given name and file path.static reactor.core.publisher.Flux<FilePartEvent> FilePartEvent.create(String name, org.springframework.core.io.Resource resource, @Nullable Consumer<HttpHeaders> headersConsumer) Creates a stream ofFilePartEventobjects based on the given name and resource.static reactor.core.publisher.Mono<FormPartEvent> -
Uses of HttpHeaders in org.springframework.http.converter
Methods in org.springframework.http.converter with parameters of type HttpHeadersModifier and TypeMethodDescriptionprotected voidAbstractHttpMessageConverter.addDefaultHeaders(HttpHeaders headers, T t, @Nullable MediaType contentType) Add default headers to the output message.protected voidStringHttpMessageConverter.addDefaultHeaders(HttpHeaders headers, String s, @Nullable MediaType type) -
Uses of HttpHeaders in org.springframework.http.converter.json
Methods in org.springframework.http.converter.json that return HttpHeadersModifier and TypeMethodDescriptionMappingJacksonInputMessage.getHeaders()Deprecated, for removal: This API element is subject to removal in a future version.Constructors in org.springframework.http.converter.json with parameters of type HttpHeadersModifierConstructorDescriptionMappingJacksonInputMessage(InputStream body, HttpHeaders headers) Deprecated, for removal: This API element is subject to removal in a future version.MappingJacksonInputMessage(InputStream body, HttpHeaders headers, Class<?> deserializationView) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of HttpHeaders in org.springframework.http.converter.xml
Methods in org.springframework.http.converter.xml with parameters of type HttpHeadersModifier and TypeMethodDescriptionAbstractJaxb2HttpMessageConverter.detectCharset(HttpHeaders httpHeaders) Detect the charset from the givenHttpHeaders.getContentType().protected abstract TAbstractXmlHttpMessageConverter.readFromSource(Class<? extends T> clazz, HttpHeaders headers, Source source) Abstract template method called fromAbstractHttpMessageConverter.read(Class, HttpInputMessage).protected TJaxb2CollectionHttpMessageConverter.readFromSource(Class<? extends T> clazz, HttpHeaders headers, Source source) protected ObjectJaxb2RootElementHttpMessageConverter.readFromSource(Class<?> clazz, HttpHeaders headers, Source source) protected ObjectMarshallingHttpMessageConverter.readFromSource(Class<?> clazz, HttpHeaders headers, Source source) protected abstract voidAbstractXmlHttpMessageConverter.writeToResult(T t, HttpHeaders headers, Result result) Abstract template method called fromAbstractXmlHttpMessageConverter.writeInternal(Object, HttpOutputMessage).protected voidJaxb2CollectionHttpMessageConverter.writeToResult(T t, HttpHeaders headers, Result result) protected voidJaxb2RootElementHttpMessageConverter.writeToResult(Object value, HttpHeaders headers, Result result) protected voidMarshallingHttpMessageConverter.writeToResult(Object o, HttpHeaders headers, Result result) -
Uses of HttpHeaders in org.springframework.http.server
Methods in org.springframework.http.server that return HttpHeadersModifier and TypeMethodDescriptionDelegatingServerHttpResponse.getHeaders()ServletServerHttpRequest.getHeaders()ServletServerHttpResponse.getHeaders() -
Uses of HttpHeaders in org.springframework.http.server.reactive
Methods in org.springframework.http.server.reactive that return HttpHeadersModifier and TypeMethodDescriptionAbstractServerHttpRequest.getHeaders()AbstractServerHttpResponse.getHeaders()ServerHttpRequestDecorator.getHeaders()ServerHttpResponseDecorator.getHeaders()Method parameters in org.springframework.http.server.reactive with type arguments of type HttpHeadersModifier and TypeMethodDescriptionServerHttpRequest.Builder.headers(Consumer<HttpHeaders> headersConsumer) Manipulate request headers.Constructors in org.springframework.http.server.reactive with parameters of type HttpHeadersModifierConstructorDescriptionAbstractListenerServerHttpResponse(org.springframework.core.io.buffer.DataBufferFactory bufferFactory, HttpHeaders headers) AbstractServerHttpRequest(HttpMethod method, URI uri, @Nullable String contextPath, HttpHeaders headers) Constructor with the method, URI and headers for the request.AbstractServerHttpResponse(org.springframework.core.io.buffer.DataBufferFactory dataBufferFactory, HttpHeaders headers) -
Uses of HttpHeaders in org.springframework.web
Methods in org.springframework.web that return HttpHeadersModifier and TypeMethodDescriptiondefault HttpHeadersErrorResponse.getHeaders()Return headers to use for the response.ErrorResponseException.getHeaders()HttpMediaTypeNotAcceptableException.getHeaders()HttpMediaTypeNotSupportedException.getHeaders()HttpRequestMethodNotSupportedException.getHeaders()Method parameters in org.springframework.web with type arguments of type HttpHeadersModifier and TypeMethodDescriptionErrorResponse.Builder.headers(Consumer<HttpHeaders> headersConsumer) Manipulate this response's headers with the given consumer. -
Uses of HttpHeaders in org.springframework.web.client
Methods in org.springframework.web.client that return HttpHeadersModifier and TypeMethodDescriptionRestClientResponseException.getResponseHeaders()Return the HTTP response headers.UnknownContentTypeException.getResponseHeaders()Return the HTTP response headers.RestOperations.headForHeaders(String url, @Nullable Object... uriVariables) Retrieve all headers of the resource specified by the URI template.Retrieve all headers of the resource specified by the URI template.RestOperations.headForHeaders(URI url) Retrieve all headers of the resource specified by the URL.RestTemplate.headForHeaders(String url, @Nullable Object... uriVariables) RestTemplate.headForHeaders(URI url) Methods in org.springframework.web.client that return types with arguments of type HttpHeadersModifier and TypeMethodDescriptionprotected ResponseExtractor<HttpHeaders> RestTemplate.headersExtractor()Return a response extractor forHttpHeaders.Methods in org.springframework.web.client with parameters of type HttpHeadersModifier and TypeMethodDescriptionstatic HttpClientErrorExceptionHttpClientErrorException.create(@Nullable String message, HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte @Nullable [] body, @Nullable Charset charset) Variant ofHttpClientErrorException.create(HttpStatusCode, String, HttpHeaders, byte[], Charset)with an optional prepared message.static HttpClientErrorExceptionHttpClientErrorException.create(HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte @Nullable [] body, @Nullable Charset charset) CreateHttpClientErrorExceptionor an HTTP status specific subclass.static HttpServerErrorExceptionHttpServerErrorException.create(@Nullable String message, HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset) Variant ofHttpServerErrorException.create(String, HttpStatusCode, String, HttpHeaders, byte[], Charset)with an optional prepared message.static HttpServerErrorExceptionHttpServerErrorException.create(HttpStatusCode statusCode, String statusText, HttpHeaders headers, byte[] body, @Nullable Charset charset) Create anHttpServerErrorExceptionor an HTTP status specific subclass.default voidApiVersionInserter.insertVersion(Object version, HttpHeaders headers) Insert the version into the request headers.Method parameters in org.springframework.web.client with type arguments of type HttpHeadersModifier and TypeMethodDescriptionRestClient.Builder.defaultHeaders(Consumer<HttpHeaders> headersConsumer) Provide a consumer to access to every default header declared so far, with the possibility to add, replace, or remove.RestClient.RequestHeadersSpec.headers(Consumer<HttpHeaders> headersConsumer) Provides access to every header declared so far with the possibility to add, replace, or remove values.Constructors in org.springframework.web.client with parameters of type HttpHeadersModifierConstructorDescriptionHttpClientErrorException(String message, HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders headers, byte @Nullable [] body, @Nullable Charset responseCharset) Constructor with a status code and status text, headers, and content, and a prepared message.HttpClientErrorException(HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders headers, byte @Nullable [] body, @Nullable Charset responseCharset) Constructor with a status code and status text, headers, and content.HttpServerErrorException(String message, HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders headers, byte @Nullable [] body, @Nullable Charset charset) Constructor with a status code and status text, headers, content, and a prepared message.HttpServerErrorException(HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders headers, byte @Nullable [] body, @Nullable Charset charset) Constructor with a status code and status text, headers, and content.protectedHttpStatusCodeException(String message, HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct instance with anHttpStatusCode, status text, content, and a response charset.protectedHttpStatusCodeException(HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct instance with anHttpStatusCode, status text, content, and a response charset.RestClientResponseException(String message, int statusCode, String statusText, @Nullable HttpHeaders headers, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance of with the given response data.RestClientResponseException(String message, HttpStatusCode statusCode, String statusText, @Nullable HttpHeaders headers, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance of with the given response data.UnknownContentTypeException(Type targetType, MediaType contentType, int statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody) Construct a new instance of with the given response data.UnknownContentTypeException(Type targetType, MediaType contentType, HttpStatusCode statusCode, String statusText, HttpHeaders responseHeaders, byte[] responseBody) Construct a new instance of with the given response data.UnknownHttpStatusCodeException(int rawStatusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance ofHttpStatusCodeExceptionbased on a status code, status text, and response body content.UnknownHttpStatusCodeException(String message, int rawStatusCode, String statusText, @Nullable HttpHeaders responseHeaders, byte @Nullable [] responseBody, @Nullable Charset responseCharset) Construct a new instance ofHttpStatusCodeExceptionbased on a status code, status text, and response body content. -
Uses of HttpHeaders in org.springframework.web.client.support
Methods in org.springframework.web.client.support that return HttpHeadersModifier and TypeMethodDescriptionRestClientAdapter.exchangeForHeaders(HttpRequestValues values) RestTemplateAdapter.exchangeForHeaders(HttpRequestValues values) -
Uses of HttpHeaders in org.springframework.web.multipart
Methods in org.springframework.web.multipart that return HttpHeadersModifier and TypeMethodDescriptionMultipartHttpServletRequest.getMultipartHeaders(String paramOrFileName) Return the headers for the specified part of the multipart request.MultipartHttpServletRequest.getRequestHeaders()Return this request's headers as a convenient HttpHeaders instance. -
Uses of HttpHeaders in org.springframework.web.multipart.support
Methods in org.springframework.web.multipart.support that return HttpHeadersModifier and TypeMethodDescriptionRequestPartServletServerHttpRequest.getHeaders()DefaultMultipartHttpServletRequest.getMultipartHeaders(String paramOrFileName) StandardMultipartHttpServletRequest.getMultipartHeaders(String paramOrFileName) AbstractMultipartHttpServletRequest.getRequestHeaders() -
Uses of HttpHeaders in org.springframework.web.server
Methods in org.springframework.web.server that return HttpHeadersModifier and TypeMethodDescriptionMethodNotAllowedException.getHeaders()Return HttpHeaders with an "Allow" header that documents the allowed HTTP methods for this URL, if available, or an empty instance otherwise.NotAcceptableStatusException.getHeaders()Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise.ResponseStatusException.getHeaders()Return headers to add to the error response, for example, "Allow", "Accept", etc.UnsupportedMediaTypeStatusException.getHeaders()Return HttpHeaders with an "Accept" header that documents the supported media types, if available, or an empty instance otherwise. -
Uses of HttpHeaders in org.springframework.web.service.invoker
Methods in org.springframework.web.service.invoker that return HttpHeadersModifier and TypeMethodDescriptionAbstractReactorHttpExchangeAdapter.exchangeForHeaders(HttpRequestValues requestValues) HttpExchangeAdapter.exchangeForHeaders(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.HttpExchangeAdapterDecorator.exchangeForHeaders(HttpRequestValues requestValues) ReactorHttpExchangeAdapterDecorator.exchangeForHeaders(HttpRequestValues requestValues) HttpRequestValues.getHeaders()Return the headers for the request, if any.Methods in org.springframework.web.service.invoker that return types with arguments of type HttpHeadersModifier and TypeMethodDescriptionreactor.core.publisher.Mono<HttpHeaders> ReactorHttpExchangeAdapter.exchangeForHeadersMono(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.reactor.core.publisher.Mono<HttpHeaders> ReactorHttpExchangeAdapterDecorator.exchangeForHeadersMono(HttpRequestValues requestValues) Methods in org.springframework.web.service.invoker with parameters of type HttpHeadersModifier and TypeMethodDescriptionprotected HttpRequestValuesHttpRequestValues.Builder.createRequestValues(@Nullable HttpMethod httpMethod, @Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate, Map<String, String> uriVars, HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> cookies, @Nullable Object version, Map<String, Object> attributes, @Nullable Object bodyValue, @Nullable org.springframework.core.ParameterizedTypeReference<?> bodyValueType) CreateHttpRequestValuesfrom values passed to theHttpRequestValues.Builder.protected ReactiveHttpRequestValuesReactiveHttpRequestValues.Builder.createRequestValues(@Nullable HttpMethod httpMethod, @Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate, Map<String, String> uriVars, HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> cookies, @Nullable Object version, Map<String, Object> attributes, @Nullable Object bodyValue, @Nullable org.springframework.core.ParameterizedTypeReference<?> bodyValueType) Method parameters in org.springframework.web.service.invoker with type arguments of type HttpHeadersModifier and TypeMethodDescriptionHttpRequestValues.Builder.configureHeaders(Consumer<HttpHeaders> consumer) Provide access to every header configured so far with the option to add, replace, or remove values.Constructors in org.springframework.web.service.invoker with parameters of type HttpHeadersModifierConstructorDescriptionprotectedHttpRequestValues(@Nullable HttpMethod httpMethod, @Nullable URI uri, @Nullable UriBuilderFactory uriBuilderFactory, @Nullable String uriTemplate, Map<String, String> uriVariables, HttpHeaders headers, org.springframework.util.MultiValueMap<String, String> cookies, @Nullable Object version, Map<String, Object> attributes, @Nullable Object bodyValue, @Nullable org.springframework.core.ParameterizedTypeReference<?> bodyValueType) ConstructHttpRequestValues. -
Uses of HttpHeaders in org.springframework.web.util
Methods in org.springframework.web.util with parameters of type HttpHeadersModifier and TypeMethodDescriptionstatic UriComponentsBuilderForwardedHeaderUtils.adaptFromForwardedHeaders(URI uri, HttpHeaders headers) static @Nullable InetSocketAddressForwardedHeaderUtils.parseForwardedBy(URI uri, HttpHeaders headers, @Nullable InetSocketAddress localAddress) Parse the first "Forwarded: by=..." header value to anInetSocketAddressrepresenting the address of the server.static @Nullable InetSocketAddressForwardedHeaderUtils.parseForwardedFor(URI uri, HttpHeaders headers, @Nullable InetSocketAddress remoteAddress) Parse the first "Forwarded: for=..." or "X-Forwarded-For" header value to anInetSocketAddressrepresenting the address of the client.