users@jersey.java.net

Posting XML data

From: John O'Conner <john_at_joconner.com>
Date: Tue, 16 Dec 2008 09:57:29 -0800

I'm having great success with GET and providing XML representations of my
backend data. However, I haven't yet successfully POSTed any XML data yet.

Questions:
1. If I have an Account class and a URL /accounts/{id} that returns an XML
representation of an account object, shouldn't I be able to provide that
same XML representation with a different ID and POST it back to /accounts to
create a new account with a new id? Maybe I should leave off the id and let
the URI processor create a new ID. Regardless, the POSTed xml should be in
exactly the same format as the GET xml right?

2. What is the best practice for testing the POST feature? Do you use curl
to send an xml representation to the uri? Something else?

THanks,
John