How to post json content?

23 views
Skip to first unread message

Gregor Frey

unread,
May 20, 2012, 2:30:00 AM5/20/12
to google-we...@googlegroups.com
Hi,
I want to us the RequestBuilder to post a json request. What is the best way to do this? What content-type should be used? How do I encode the content? Can I send the content with the request body?
The content type "url-form-encoded" is not quite right, because I have a deeply nested java script object, and not a list of key-value pairs. On the other hand the content type "application/json"  doesn't indicate any encoding. But without being url-encoded the json-content gets ruined, when containing special characters and being send in the request header.
Gregor 
Reply all
Reply to author
Forward
0 new messages