« Return to Thread: Sending JSON Data to a server

Re: Sending JSON Data to a server

by Jochen Luig-2 :: Rate this Message:

Reply to Author | View in Thread

Hi,

Am Donnerstag, den 07.08.2008, 12:11 +0000 schrieb Anthony Fryer:

> I send json to the server using xhrPost by assigning the json a
> parameter.
>  
> ie.
>  
> dojo.xhrPost({
>   url: './blah',
>   content: { json: dojo.toJson(myJsonObject) }
> });
>  
> On the server i just get the "json" parameter value and deserialize
> it.

Yes, I read about that approach in the forums. The problem with this is
that my server will just take the HTTP-Request's body and try to
serialize it. Thus, your way will leave me having to deserialize the
data myself (as long as I don't want to introduce some ugly hack into my
App).

Bye,

Jochen

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

 « Return to Thread: Sending JSON Data to a server