• Post Reply Bookmark Topic Watch Topic
  • New Topic

"The request sent by the client was syntactically incorrect" in Restful App in chrome  RSS feed

 
mariyam saeed
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using the auto generated restful web services codes from netbeans, and i am testing the restful web service using advanced rest client in chrome and i am having the Sql Database,
i have tried to recieve all rows in the table using GET, and it is working successfully,
but when i tried "POST", OR "PUT" it gives me this error, can sumbody help
s.PNG
[Thumbnail for s.PNG]
GET
2e.PNG
[Thumbnail for 2e.PNG]
POST
 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, presumably the RESTful service only handles that URL as a GET?
Are the POST/PUT URLs different?

Without seeing our code it'll be hard to tell, but that's what that error implies.
 
Anurag Verma
Ranch Hand
Posts: 168
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as clear from the message itself the request you are sending is not correct, probably the service URI or the parameters required are not being sent correctly.
 
mariyam saeed
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, thanks for your reply, the POST / PUT url not different.
i have changed the URL and it still gives me the error
GET is working fine, but POST AND DELETE is giving me error
qdwda.PNG
[Thumbnail for qdwda.PNG]
GET
222.PNG
[Thumbnail for 222.PNG]
POST
 
mariyam saeed
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have generated entities and restful web service in netbeans. the code details are
countryFacadeREST.java


Country,java

 
Dave Tolls
Ranch Hand
Posts: 2504
27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the URL for PUT is different, in that it expects an id at the end.

And the POST expects either XML or JSON in the body that represents a Country.
 
mariyam saeed
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply, can you give me an example how to POST for country in XML OR JSON
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!