Content-Type: HTTP entity-header

Set or return the class of the JMS message in a WebSphere® MQ message according the to HTTP content-type.

Type Description
HTTP header name Content-Type
HTTP header type Entity-header
Valid in HTTP request message POST, x-msg-require-headers
Allowed or returned value
media-type
For media-types that are supported see Table 1.
Table 1. Mapping between x-msg-class and HTTP Content-Type
x-msg-class HTTP Content-Type
BYTES
application/octet-stream
application/xml
TEXT
text/*
MAP
application/x-www-form-urlencoded
application/xml (optional)
STREAM
application/xml (optional)

Description

  • On an HTTP POST request, specify either the Content-Type or the x-msg-class. If you specify both, they must be consistent or an HTTP Bad Request exception, Status code 400 is returned. If you omit both, the Content-Type and the x-msg-class, a Content-Type of text/* is assumed.
  • The Content-Type is always set in the response to an HTTP GET or DELETE that has a message body. The Content-Type is set according to the rules in Table 2.
Table 2. Mapping message types to x-msg-class and Content-Type
Message format JMS Message type x-msg-class Content-Type
Anything except MQFMT_STRING None BYTES application/octet-stream
MQFMT_STRING None TEXT text/plain
MQFMT_NONE jms_bytes BYTES application/octet-stream
MQFMT_NONE jms_text TEXT text/plain
MQFMT_NONE jms_map MAP application/xml
MQFMT_NONE jms_stream STREAM application/xml