| Author |
re: REST return a response status of 406
|
Mark Curlette
Ranch Hand
Joined: May 26, 2011
Posts: 30
|
|
Hello,
I am new to REST , and I am trying to figure out why it gives me a return status code of 406.
Please help me to shed some light into this.
I have create a web dynamic project called RestSimpleApp. It contains three sample programs in three different packages as follow :
I was able to view the result of my order through the web browser as http://localhost:8080/RestSimpleApp/rest/orders. However, I got the return reponse status of 406 when I tried to call it from a client program which I have created in another web dynamic project as follow
I am awared that I may miss some important things but I could not figure out, so please help me if you can.
Thanks so much in advance,
Tom
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56201
|
|
What's the Accept header on the request? 406 usually means that you've asked for a media type that isn't possible to generate.
It looks look your service is limited to XML and JSON.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Mark Curlette
Ranch Hand
Joined: May 26, 2011
Posts: 30
|
|
|
Thanks so much Bear. It worked when I change my request to MediaType.APPLICATION_XML or MediaType.APPLICATION_JSON. I remember now to pay attention to the accept header of the request.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56201
|
|
|
 |
 |
|
|
subject: re: REST return a response status of 406
|
|
|