• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 171
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your reply, can you give me an example how to POST for country in XML OR JSON
 
reply
    Bookmark Topic Watch Topic
  • New Topic