Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HTTP Status 415 - Unsupported Media Type  RSS feed

 
Ricky Marfori
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web service using jersey and a php client. I am getting HTTP Status 415 - Unsupported Media Type whenever i call the the web service using curl in php.

this is how I did it.

first i have uploaded a form and serialized the data into json string.



and this is how my resource looks like



So i am sure i have 'Content-Type: application/json' in my curl, what could be the problem?
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Perhaps the accept header is missing
'Accept': 'application/json',
'Content-Type': 'application/json'



Best regards,
 
Ricky Marfori
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to Carles Gasques ,

It has 'Accept: application/json','Content-Type: application/json'
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would first use TCPMON or SOAPui to find out exactly what is being sent in that request and the exact text of the response.

Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!