Package org.apache.cxf.transport.http
Class Headers
java.lang.Object
org.apache.cxf.transport.http.Headers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEach header value is added as a separate HTTP header, example, given A header with 'a' and 'b' values, two A headers will be added as opposed to a single A header with the "a,b" value.static final Stringstatic final Stringstatic final Stringstatic final StringThis constant is the Message(Map) key for the HttpURLConnection that is used to get the response.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyFromRequest(jakarta.servlet.http.HttpServletRequest req) Copy the request headers into the message.protected voidcopyToResponse(jakarta.servlet.http.HttpServletResponse response) Copy the response headers into the response.static SimpleDateFormatgetSetProtocolHeaders(org.apache.cxf.message.Message message) While extracting the Message.PROTOCOL_HEADERS property from the Message, this call ensures that the Message.PROTOCOL_HEADERS property is set on the Message.static StringvoidreadFromConnection(HttpURLConnection connection) voidvoidsetAuthorization(String authorization) voidsetProtocolHeadersInConnection(HttpURLConnection connection) Set content type and protocol headers (Message.PROTOCOL_HEADERS) headers into the URL connection.voidsetProxyAuthorization(String authorization) static StringtoHttpDate(Date date) static StringtoHttpLanguage(Locale locale) voidwriteSessionCookies(Map<String, Cookie> sessionCookies) Write cookie header from given session cookies
-
Field Details
-
KEY_HTTP_CONNECTION
This constant is the Message(Map) key for the HttpURLConnection that is used to get the response.- See Also:
-
ADD_HEADERS_PROPERTY
Each header value is added as a separate HTTP header, example, given A header with 'a' and 'b' values, two A headers will be added as opposed to a single A header with the "a,b" value.- See Also:
-
PROTOCOL_HEADERS_CONTENT_TYPE
-
HTTP_HEADERS_SETCOOKIE
- See Also:
-
HTTP_HEADERS_LINK
- See Also:
-
EMPTY_REQUEST_PROPERTY
- See Also:
-
-
Constructor Details
-
Headers
public Headers(org.apache.cxf.message.Message message) -
Headers
public Headers()
-
-
Method Details
-
getUserAgent
-
headerMap
-
writeSessionCookies
Write cookie header from given session cookies- Parameters:
sessionCookies-
-
removeAuthorizationHeaders
public void removeAuthorizationHeaders() -
setAuthorization
-
setProxyAuthorization
-
getSetProtocolHeaders
public static Map<String,List<String>> getSetProtocolHeaders(org.apache.cxf.message.Message message) While extracting the Message.PROTOCOL_HEADERS property from the Message, this call ensures that the Message.PROTOCOL_HEADERS property is set on the Message. If it is not set, an empty map is placed there, and then returned.- Parameters:
message- The outbound message- Returns:
- The PROTOCOL_HEADERS map
-
readFromConnection
-
setProtocolHeadersInConnection
Set content type and protocol headers (Message.PROTOCOL_HEADERS) headers into the URL connection. Note, this does not mean they immediately get written to the output stream or the wire. They just just get set on the HTTP request.- Parameters:
connection-- Throws:
IOException
-
determineContentType
-
copyFromRequest
protected void copyFromRequest(jakarta.servlet.http.HttpServletRequest req) Copy the request headers into the message.- Parameters:
req- the current servlet request
-
copyToResponse
protected void copyToResponse(jakarta.servlet.http.HttpServletResponse response) Copy the response headers into the response.- Parameters:
response- the current ServletResponse
-
getAuthorization
-
getHttpDateFormat
-
toHttpDate
-
toHttpLanguage
-