Software AG Products 10.11 | Administering Integration Server | Content Handlers in Integration Server | About Content Handlers for HTTP Responses | Accept Header Field
 
Accept Header Field
The Accept header field specifies which content type or types the client will accept in the response. The Accept header field can specify multiple acceptable content types, either by listing them (application/json, text/html, text/xml, and so on), or by using wildcards (text/*).
By default, if the Accept header specifies a content type using a wildcard, Integration Server will select the first content handler registered for that major type (text, application, multipart).
The following table identifies the content handler that Integration Server selects based on the value of the Accept header field.
This Accept Header field
Results in this content handler
text/*
XML
application/*
CGI
multipart/*
Multipart
To control which content handler Integration Server will use when a wildcard is specified in the Accept header, you must use the watt.server.content.type.mappings server configuration parameter. The syntax for this parameter is:
watt.server.content.type.mappings=<wildcard1> <content-type1>,<wildcard2> <content-type2>,<wildcardN> <content-typeN>
For example, to associate text/* with text/xml and multipart/* with multipart/related, specify the parameter as follows:
watt.server.content.type.mappings=text/* text/xml,multipart/* multipart/related
The Accept header might contain multiple content types with parameters indicating an order of preference. Integration Server will attempt to respond with the "most preferred" content type as defined by RFC 2616, section 14.
If a request includes multiple media types in the Accept header but did not specify a factor weighting ("q" parameter) for any of them, Integration Server attempts to respond with the first media type in the Accept header. If there is no content handler defined for the first media type, it attempts to respond with the second media type from the Accept header. This repeats until Integration Server finds a media type with which it can respond in the Accept header. If none are found, that is, there is not a content handler registered for any of the media types in the Accept header, Integration Server will respond with the text/html media type.
Software AG recommends that when clients send an Accept header with multiple media types, they use "q" parameters to indicate an order of preference for the media type of the response.
Integration Server supports the Accept header field in HTTP request headers if the watt.server.http.useAcceptHeader configuration parameter is set to true. The default setting for this parameter is true.