Package com.jsql.util
Class HeaderUtil
java.lang.Object
com.jsql.util.HeaderUtil
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckResponseHeader
(HttpRequest.Builder httpRequestBuilder, String body) Verify the headers received after a request, detect authentication response and send the headers to the view.static void
sanitizeHeaders
(HttpRequest.Builder httpRequest, AbstractMap.SimpleEntry<String, String> header) Parse the header component and decode any character of the form %xy except for cookie
-
Field Details
-
CONTENT_TYPE_REQUEST
- See Also:
-
WWW_AUTHENTICATE_RESPONSE
- See Also:
-
-
Constructor Details
-
HeaderUtil
-
-
Method Details
-
sanitizeHeaders
public static void sanitizeHeaders(HttpRequest.Builder httpRequest, AbstractMap.SimpleEntry<String, String> header) throws JSqlExceptionParse the header component and decode any character of the form %xy except for cookie- Parameters:
httpRequest
- where decoded value will be setheader
- string to decode- Throws:
JSqlException
-
checkResponseHeader
public HttpResponse<String> checkResponseHeader(HttpRequest.Builder httpRequestBuilder, String body) throws IOException, InterruptedException Verify the headers received after a request, detect authentication response and send the headers to the view.- Parameters:
httpRequestBuilder
- calls URLbody
-- Returns:
- httpResponse with response headers
- Throws:
IOException
- when an error occurs during connectionInterruptedException
-