Class NettyHttpHelper
java.lang.Object
org.apache.camel.component.netty.http.NettyHttpHelper
Helpers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Appends the key/value to the headers.static io.netty.handler.codec.http.HttpMethod
createMethod
(org.apache.camel.Message message, boolean hasPayload) Creates theHttpMethod
to use to call the remote server, often either its GET or POST.static URI
Creates the URI to invoke.static String
createURL
(org.apache.camel.Exchange exchange, NettyHttpEndpoint endpoint) Creates the URL to invoke.static Object
static Exception
populateNettyHttpOperationFailedException
(org.apache.camel.Exchange exchange, String url, io.netty.handler.codec.http.FullHttpResponse response, int responseCode, boolean transferException)
-
Method Details
-
appendHeader
Appends the key/value to the headers. This implementation supports keys with multiple values. In such situations the value will be aList
that contains the multiple values.- Parameters:
headers
- headerskey
- the keyvalue
- the value
-
createMethod
public static io.netty.handler.codec.http.HttpMethod createMethod(org.apache.camel.Message message, boolean hasPayload) Creates theHttpMethod
to use to call the remote server, often either its GET or POST.- Parameters:
message
- the Camel message- Returns:
- the created method
-
populateNettyHttpOperationFailedException
-
deserializeJavaObjectFromStream
public static Object deserializeJavaObjectFromStream(InputStream is) throws ClassNotFoundException, IOException - Throws:
ClassNotFoundException
IOException
-
createURL
Creates the URL to invoke.- Parameters:
exchange
- the exchangeendpoint
- the endpoint- Returns:
- the URL to invoke
-
createURI
public static URI createURI(org.apache.camel.Exchange exchange, String url) throws URISyntaxException Creates the URI to invoke.- Parameters:
exchange
- the exchangeurl
- the url to invoke- Returns:
- the URI to invoke
- Throws:
URISyntaxException
-