> I think browser should urlencode xml data,but don't do that for
> plaintext just like my json post data.


It depends on what browser facility you use.  Submitting a regular form from
an HTML page, the content will always be url-encoded.  If you use
XmlHttpRequest and POST, your Javascript is responsible for supplying all
the entity data, including doing any url-encoding or not.

Restlet's Form abstraction assumes url-encoding (which is the correct
behavior), so you can't use it if the data is not url-encoded.  But you
don't need to armor your JSON object in a Form, you can skip the Form
wrapper altogether and just structure your entire entity in JSON, which is
what most folks do -- then you can leverage the JSON facilities in Restlet
directly.

- R

Reply via email to