Reputation: 21
I'm using Azure API management for my project, with a backend service provided by Fiorano ESB. Fiorano to Azure has a peer-to-peer connectivity. The services is deployed in the peer server which is added as a cloud service in azure. So my concern is : for an API, in the URL if the resource is missing or wrong by default we'll get a json response as
{
"stausCode" : 404,
"message" : "Resource not found"
}
Is there any way that I can define this in OData standard format i.e. can i define it in a custom format as given below:
{
"error":{
"code" : "404_RES",
"message":{
"lang":"en-uk",
"value":"Resource $(wrong_resource given) is not found"
},
"innererror":{
"trace":[],
"context":{}
}
}
}
The $(wrong resource) should be taken dynamically
Upvotes: 2
Views: 1672
Reputation: 606
Take a look at set-body policy: https://msdn.microsoft.com/en-us/library/azure/dn894083.aspx#SetBody. Basically, it allows you to modify/replace message bodies of incoming and outgoing requests.
Upvotes: 1