dev@glassfish.java.net

Re: How to POST a list of strings ?

From: Farjola Zaloshnja <farjola.zaloshnja_at_gmail.com>
Date: Fri, 14 Nov 2008 10:05:19 +0100

will this work ?


ClientResponse resp = c.handle(cr);

JSONObject jobj = *new* JSONObject(resp.toString());

JSONArray jas = *new* JSONArray().put(jobj);


On Thu, Nov 13, 2008 at 10:30 AM, Farjola Zaloshnja <
farjola.zaloshnja_at_gmail.com> wrote:

> Hi,
> I haven't used much the POST function in the jsr311 framework but if I were
> to post a list of strings will this be correct?
>
> On the client side:
>
>
> Client c = Client.*create*();
>
> URI url =
> *new* URI("getmylist");
>
> ClientRequest cr = ClientRequest.*create*().entity(List<String> mylist,
> "application/json").build(url, "POST");
>
> And the server side receiving will look like:
>
>
>
> @POST
> @Path("getmylist")
>
> *public* void getmylist(List<String> programids){ }
>
>
>
> Any comments ?
>
> Thank you,
>
> Farjola
>
>
>
>
>
>
>