We want to return the reason phrase as “Upgrade Required” for the response code 426 as shown below:
HTTP/1.1 426 Upgrade Required
To achieve this, we invoke the below RaiseFault policy when a certain condition is met:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <RaiseFault async="false" continueOnError="false" enabled="true" name="RaiseFault"> <DisplayName>RaiseFault</DisplayName> <FaultResponse> <Set source="response"> <Payload contentType="text/plain"/> <StatusCode>426</StatusCode> <ReasonPhrase>Upgrade Required</ReasonPhrase> </Set> </FaultResponse> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> </RaiseFault>
However, when we get the response from the API request we get it as follows:
HTTP/1.1 426 Unknown
Somehow reason phrase is returned incorrectly.
This layer could be anything Akamai, F5 etc. If a similar issue is observed, please do check if there are any other layers exist between the client application and Apigee Edge. Verify if that layer is making any modifications to the reason phrase.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |