Sending and Consuming HTTP Headers

You can send and consume HTTP headers from the REST operation invocations, using context parameters on REST reference and service bindings. The values populated by the REST binding, map HTTP Transport headers to context parameters.

In the case of REST reference bindings, using context mapping, the values set by the Implementation type can be sent as HTTP Headers as part of the REST request. Also, the HTTP Headers received as part of the REST response, can be made available to the Implementation Type.

In the case of REST service bindings, using context mapping, the values of the HTTP Transport Headers can be made available to the Implementation Type (for example, Java IT). Also, the values set by the Implementation Type can be sent as HTTP Transport Headers as part of the REST response.

Note: The Content-Type or Accept headers are not supported in context parameters and the REST Resource Configuration (RRC) file. That is, you cannot add a context parameter with the name as Content-Type or Accept. In the RRC file, you cannot add Content-Type or Accept as a Request Parameter.

For details on configuring the Inbound, Outbound, and Fault messages for service and reference, refer to the following sections. A sample project is provided as part of the installation in TIBCO_HOME/amx/<version>/samples/rest/samples/rest.context​ to elaborate on the same​​. Refer to the /rest.context​/Readme.pdf​​ for details.