Setting Content-Type for Error Response
Using TIBCO API Exchange Gateway, you can set the Content-Type for the error message.
When the error response is returned for any incoming request from TIBCO API Exchange Gateway, the content-type of the error response is set as follows:
- The Content-Type can be set based on the Accept Header of the incoming request.
- If the HTTP header of the incoming request message contains the Accept Header, TIBCO API Exchange Gateway sets the content type of the error response to the content type specified in the Accept Header of the request message.
- If the HTTP header of the incoming request message does not contain the Accept Header, TIBCO API Exchange Gateway sets the content type of the error response using the tibco.clientVar.ASG/Response/DefaultContentType property. The property is set in the ASG_CONFIG_HOME/asg.properties file. See tibco.clientVar.ASG/Response/DefaultContentType.
Note: If the
tibco.clientVar.ASG/Response/DefaultContentType
property is not set, TIBCO API Exchange Gateway sets the Content-Type of the error response message to application/json.
To set the Content-Type for the error response from TIBCO API Exchange Gateway for any incoming request, follow these steps:
- Procedure
- Navigate to the ASG_CONFIG_HOME directory.
- Edit the asg.properties file in a text editor.
- Set the following property :
tibco.clientVar.ASG/Response/DefaultContentType
For example, you can set the property to
application/xml
as follows:
tibco.clientVar.ASG/Response/DefaultContentType=application/xml
Note:- If the
tibco.clientVar.ASG/Response/DefaultContentType
property is set toapplication/XML
ortext/XML
, the error response is returned inXML
format to the requester. - If the
tibco.clientVar.ASG/Response/DefaultContentType
property is set toapplication/JSON
, the error response is returned inJSON
format to the requester.
- If the
Subtopics