users@jersey.java.net

Re: [Jersey] Posting JSON with Content-Type application/json (jQuery)

From: sarat.pediredla <sarat.pediredla_at_gmail.com>
Date: Sat, 29 Nov 2008 01:29:07 -0800 (PST)

Hi Naresh,

I don't think this is the same issue. Sorry if I missed mentioning this but
I am running on Mac OSX Leopard in Jetty 6. Also, the call is not being made
from a WebResource client but actually from the browser (Firefox 3). I tried
the same POST using cURL at the command line but I get the same problems.

Does this mean the problem lies with Jetty? Is there a work-around I can
implement? One thing I am confused about is that the JSON POST seems to
invoke a SAXParser, which I thought was for XML. I also know that the
"Content is NOT allowed in Prolog" is only an issue with XML content.

I implemented a custom @Provider and logged the MediaType being passed in
the POST and it correctly says application/json, so I wonder why Jersey
thinks the content is XML?


Srinivas Naresh Bhimisetty wrote:
>
> Hi Sarat,
>
> are you trying this using the HTTPServer for deployments, and in the
> Windows environment?
> I have observed the same behavior on Windows while using
> "application/json", it however works fine in other environments like
> Linux or Solaris.
> This appears to be a bug with the light-weight HTTP Server on Windows.
> Please check the attached mail thread for more details.
>
> Thanks,
> Naresh
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
For additional commands, e-mail: users-help_at_jersey.dev.java.net


-- 
View this message in context: http://n2.nabble.com/Posting-JSON-with-Content-Type-application-json-%28jQuery%29-tp1590347p1591905.html
Sent from the Jersey mailing list archive at Nabble.com.