HTTP headers

The IBM MQ bridge for HTTP supports custom request HTTP headers, custom entity HTTP headers, and a subset of standard HTTP headers.

HTTP practice is to prefix all custom headers with x-, so the IBM MQ Bridge for HTTP headers are prefixed with x-msg-. For example, to set the priority header use x-msg-priority.

Note:

  • Most header values are case sensitive. For example, when using the msgId header, NONE is a keyword, whereas none is a msgID.
  • Misspelled headers are ignored.


Custom entity HTTP headers

The custom entity HTTP headers contain information about IBM MQ messages. Using entity headers, we can set values in the message descriptor ( MQMD), or query values in the MQMD. An additional entity header, x-msg-usr, sets and returns any user property information you want to associate with a request.

We can use entity headers in different HTTP request contexts:

    DELETE
    We can only use the x-msg-correlId, or x-msg-msgId, or both, entity headers with a DELETE HTTP request. The effect of the headers is to select a particular message by MsgId and CorrelId in an MQGET, and to delete the message from its queue.

    GET
    We can only use the x-msg-correlId, or x-msg-msgId, or both, entity headers with a GET HTTP request. The effect of the headers is to select a particular message by MsgId and CorrelId in an MQGET for browse.

    POST
    We can use any entity header in a POST HTTP request, except x-msg-timestamp.

    x-msg-require-headers
    On any GET, POST or DELETE HTTP request, we can add multiple entity headers inside the x-msg-require-headers request header, separated by commas. The effect is to return the specified entity headers in the HTTP response message, containing the value of the associated message property.

The description of each header lists in which contexts the header is processed by IBM MQ bridge for HTTP. For example, in the header POST, x-msg-require-headers, the header is processed by IBM MQ bridge for HTTP in an HTTP POST request, or in the x-msg-require-headers request header in either an HTTP POST, GET, or DELETE request. If the header is included in a context it is not allowed in, the header is ignored. No error is reported.

We can put any standard HTTP headers into requests to be processed by the Web server, or other request handlers. Similarly, the response might contain other standard HTTP headers inserted by the Web server or other response handlers.


Custom request HTTP headers

The three custom request HTTP headers, x-msg-range, x-msg-require-headers, and x-msg-wait, pass additional information about the HTTP request to the server. They act as request modifiers. With x-msg-range, we can restrict the amount of message data returned in a response. With x-msg-require-headers, we can request the response to contain information about the result of the request. With x-msg-wait, we can modify the time the client waits for an HTTP response.


Standard HTTP headers

The Host standard HTTP request-header must be specified in an HTTP/1.1 request.

The Content-Length and Content-Type standard HTTP entity headers can be specified in a request.

The Content-Length, Content-Location, Content-Range, Content-Type, and Server standard HTTP entity headers can be returned in response to a request. Specify one or more of the standard HTTP headers in the x-msg-request-header header in the request message.


Alphabetic list of HTTP headers