Author Message
ShantalaGowda2
Joined: Nov 6, 2013
Messages: 26
Offline
We have a REST API with GET request which expects Content-Type in header with value as 'application/json'. We have required setup on AOD and when we test we get error "415 Error: Unsupported Media Type".

As per backend team, Server is receiving the content-type as "application/x-www-form-urlencoded; charset=UTF-8".

We are not sure where Content-Type is getting changed even though e set it to 'application/json'.

NOTE: Request works fine if tested from SOAPUI. We see issue only when called from AOD.

Can we know what could be issue and how it can be resolved? How do we make sure AOD sends Content-Type as 'application/json'?
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
The web service shouldn't care about the content-type for the GET method. OD sets it. You can't change it. Try to add the Accept header. That's what matters when web service returns JSON to the client (OD app).
ShantalaGowda2
Joined: Nov 6, 2013
Messages: 26
Offline
We have already tried adding Accept in header and still get same error.
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
If you are sure the content-type is the problem, we can't really help. OD has it hard coded to send "application/x-www-form-urlencoded", which should be expected by GET method of a REST web service. You may want to write some custom JAVA code to do this on your own.
Go to:   
Mobile view