...
Code Block |
---|
http:hostname[:port][/resourceUri][?options] |
Will by default use port 80 for http HTTP and 443 for httpsHTTPS.
You can append query options to the URI in the following format, ?option=value&option=value&...
Info | ||
---|---|---|
| ||
You can only produce to endpoints generated by the HTTP component. Therefore it should never be used as input into your camel Routes. To bind/expose an HTTP endpoint via a http HTTP server as input to a camel route, you can use the Jetty Component |
...
Name | Default Value | Description |
---|---|---|
| | Camel 2.0: Option to disable throwing the |
| | Reference to a |
| | Username for basic http authenticationBasic HTTP Authentication. |
| | Password for basic http authenticationBasic HTTP Authentication. |
| | The proxy host name * only for >= Camel 1.6.2 *. |
| | The proxy port number * only for >= Camel 1.6.2 *. |
| | Username for proxy authentication * only for >= Camel 1.6.2 *. |
| | Password for proxy authentication * only for >= Camel 1.6.2 *. |
| | Reference to a |
| | Setting options on the HttpClientParams. For instance |
Message Headers
Camel 1.x
Name | Type | Description |
---|---|---|
| | Camel 1.5.1: URI to call. Will override existing URI set directly on the endpoint. Is set on the IN In message. |
| | The http HTTP response code from the external server. Is 200 for OK. Is set on the OUT Out message. |
| | URI parameters. Will override existing URI parameters set directly on the endpoint. Is set on the IN In message. |
Camel 2.0
Name | Type | Description |
---|---|---|
| | URI to call. Will override existing URI set directly on the endpoint. Is set on the IN In message. |
| | Request URI's path. Is set on the IN In message. |
| | URI parameters. Will override existing URI parameters set directly on the endpoint. Is set on the IN In message. |
| | Character encoding. Is set on the IN In message. |
| | Content type. Is set on the IN In message. |
| | The http HTTP response code from the external server. Is 200 for OK. Is set on the OUT Out message. |
NOTE from Camel 2.0m2, we move the message headers' constants from HttpConstants
to Exchange
.
Message Body
Camel will store the http HTTP response from the external server on the OUT Out body. All headers from the IN In message will be copied to the OUT Out message, so headers is are preserved during routing.
Additionally Camel will add the http HTTP response headers as well to the OUT Out message.
Response code
Camel will handle according to the http HTTP response code:
- response Response code is between in the range 100..299 then , Camel regard regards it as a success response.
- response Response code is between in the range 300..399 then , Camel regard regards it as a redirection was returned response and will throw a
HttpOperationFailedException
with the information. - response Response code is 400+ then , Camel regard regards it as a an external server failure and will throw a
HttpOperationFailedException
with the information.Tip title throwExceptionOnFailure The option,
throwExceptionOnFailure
, can be set tofalse
to prevent theHttpOperationFailedException
to be from being thrown for failed response codes. This allows you to get any response from the remote server.
There is a sample below demonstrating this.
...
This exception contains the following information:
- the http The HTTP status code
- the http The HTTP status line (text of the status code)
- redirect Redirect location, if server returned a redirect
- responseBody Response body as a
java.io.InputStream
, if server provided a body as response
...