API Gateway: How to set the content-type in a Route via HTTP(S) assertion for use by backend.
search cancel

API Gateway: How to set the content-type in a Route via HTTP(S) assertion for use by backend.

book

Article ID: 142600

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

The API Gateway is sending an undesired content-type in the Route via HTTP(S) assertion to the backend, causing the request sent to the backend to fail. The backend is expecting a content-type of application/json (for example) and the Gateway is sending text/xml. This article will discuss how to set the desired content-type.

Environment

This affects all supported Gateway versions.

Cause

The Gateway will - by default - use the content-type specified in the request, which may not always be desirable by the backend.

Resolution

Various headers can be overwritten by using the Manage Transport Properties/Headers assertion.

The headers can be manipulated in the Route via HTTP(S) assertion by following the instructions in the documentation here which walks through three different use-cases: https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-gateway/11-1/policy-assertions/assertion-palette/message-routing-assertions/route-via-http-s-assertion.html