users@jersey.java.net

Re: [Jersey] New to REST/Jersey: How to POST json/xml for crud operations

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 17 Dec 2008 11:46:36 +0100

Hi Richard,

On Dec 16, 2008, at 11:09 AM, Richard Catlin wrote:

> All,
>
> Using NetBeans 6.5, I created a RESTful webservice from the sample
> database Manufacturers table. I use the "Test RESTful Webservice"
> feature of Netbeans and once the browser launches, I can view the
> list of the Manufacturers as well as the detail for each.
>
> How do I create, update, and delete? I assume it is through the
> "POST(application/xml)" and "POST(application/json)". I'm not sure
> what the syntax is to enter into the box. Is there an example of
> this?
>

If you want to create a new entry then you POST content to the
Manufacturers resource. The easiest way to do that is to copy an
existing Manufacturer content and past it into the Content text box,
just make sure if you copy XML you POST XML.

To DELETE select a Manufacturer and select the DELETE method to test.

To update select a Manufacturer and select the PUT method to test. The
simplest approach is to do a GET on the Manufacturer you want to
update, copy the raw view, then select PUT and paste the raw, then
modify it.

Hope this helps,
Paul,

> Thank you.
> Richard Catlin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>