Package org.apache.camel.http.base
Class HttpHelper
java.lang.Object
org.apache.camel.http.base.HttpHelper
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidAppends the key/value to the headers.static voidevalPlaceholders(BiConsumer<String, Object> keyPairConsumer, String path, String consumerPath) In the endpoint the user may have defined rest {} placeholders.static voidIn the endpoint the user may have defined rest {} placeholders.static ObjectextractHttpParameterValue(String value) Extracts the parameter value.static booleanisSecureConnection(String uri) static booleanisStatusCodeOk(int statusCode, String okStatusCodeRange) Checks whether the given http status code is within the ok rangestatic int[]static voidsetCharsetFromContentType(String contentType, org.apache.camel.Exchange exchange) 
- 
Method Details- 
isSecureConnection
- 
parserHttpVersion- Throws:
- ProtocolException
 
- 
setCharsetFromContentTypepublic static void setCharsetFromContentType(String contentType, org.apache.camel.Exchange exchange) 
- 
appendHeaderAppends the key/value to the headers. This implementation supports keys with multiple values. In such situations the value will be aListthat contains the multiple values.- Parameters:
- headers- headers
- key- the key
- value- the value
 
- 
extractHttpParameterValueExtracts the parameter value. This implementation supports HTTP multi value parameters which is based on the syntax of [value1, value2, value3] by returning aListcontaining the values. If the value is not a HTTP multi value the value is returned as is.- Parameters:
- value- the parameter value
- Returns:
- the extracted parameter value, see more details in javadoc.
 
- 
isStatusCodeOkChecks whether the given http status code is within the ok range- Parameters:
- statusCode- the status code
- okStatusCodeRange- the ok range (inclusive)
- Returns:
- true if ok, false otherwise
 
- 
evalPlaceholderspublic static void evalPlaceholders(Map<String, Object> headersMap, String path, String consumerPath) In the endpoint the user may have defined rest {} placeholders. This helper method map those placeholders with data from the incoming request context path- Parameters:
- headersMap- a Map instance containing the headers
- path- the URL path
- consumerPath- the consumer path
 
- 
evalPlaceholderspublic static void evalPlaceholders(BiConsumer<String, Object> keyPairConsumer, String path, String consumerPath) In the endpoint the user may have defined rest {} placeholders. This helper method map those placeholders with data from the incoming request context path- Parameters:
- keyPairConsumer- a consumer for the placeholder key pair
- path- the URL path
- consumerPath- the consumer path
 
 
-