Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to create a custom error that returns the contents of the body from a POST method when a 400 " Server cannot read malformed syntax"

Not applicable
curl -X POST -H "Authorization: Basic 12345" -H "Cache-Control: no-cache"  -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=refresh_token&refresh_token=12345' "https://apidev.oppenheimerfunds.com/oauth2/v2/token"

I get an error when the refresh_token is not in the correct format. A 400 BAD REQUEST "Server unable to read malformed syntax".

How do I write a custom error when receiving this 400 so that apigee returns the refresh_token to the client?

Thanks!

0 1 144
1 REPLY 1