HTTP Response


The HTTP Response node sends responses back to requests received from an HTTP Server node.

Node Type


Action.

Input and Output Ability


This node has 1 entry point and 0 exit points. The input can be any format.


Note

One of the upstream nodes of this node must include an HTTP Server <http_server> node.

Node Properties


../../_images/http_response.png


Name

The name for this node.


Status Code

The HTTP Response status code. You can enter your own code or use the default value 200.

Headers

The header content for the HTTP Response. Enter the content in key-value pairs. If any key is repeated, the key-value pair of the last entered key will be used.


Click + Add to add more header content. You can have a maximum of 10 headers.


Body

The header body for the HTTP Response. The code entered here will replace the input msg and output as msg to the next node.


Description

The description for this node.

Limitations


Maximum number of headers: 10

Samples

Input Sample


{
  "MetaData": {
    "CamelHttpUrl": "http://beta-iot-as-mqtt-cn4.eniot.io:9090/o10928374652-36b463cc228034000",
    "Accept": "*/*",
    "Connection": "keep-alive",
    "User-Agent": "PostmanRuntime/7.26.8",
    "Host": "beta-iot-as-mqtt-cn4.eniot.io:9090",
    "Accept-Encoding": "gzip, deflate, br",
    "CamelHttpServletRequest": "org.apache.camel.component.jetty9.filters.BodyReaderRequestWrapper@5af8f3c6",
    "CamelHttpServletResponse": "HTTP/1.1 200 \n\r\n",
    "CamelHttpMethod": "POST",
    "CamelServletContextPath": "/o10928374652-36b463cc228034000",
    "Postman-Token": "1bff2cn8-d34e-45c6-b8b2-3a855756d46b",
    "Content-Length": "0",
    "CamelHttpUri": "/o10928374652-36b463cc228034000",
    "CamelHttpPath": ""
  },
  "Body": {
    "Type": "application/json",
    "Length": 2,
    "Encoding": "gzp"
  }
}

Output Sample


{
  "MetaData": {
    "CamelHttpResponseCode": "202",
    "Content-Type": "application/json",
    "Location":"SG"
  },
  "Body": {
    "a": "b"
  }
}