I'm sending date to a server via json using the following code:

req = new qx.io.remote.Request(url, qx.net.Http.METHOD_POST,
                                     qx.util.Mime.JSON)
var json = {
    experiment : this.experiment,
    year       : date.getFullYear(),
    month      : date.getMonth() + 1,
    day        : date.getDate(),
    revision   : this.revision,
    log_text   : this.editBox.getComputedValue()
}
alert(qx.io.Json.stringify(json))
req.setData('json=' + qx.io.Json.stringify(json))
req.send()

First, I'm not sure if this is the best way to do this. I'm using POST 
because the data could be large.

On the other end mod_python reads the json text as if it were in a form 
field, i.e.

param      = cjson.decode(req.form['json'])
experiment = param['experiment']
date       = datetime.date(param['year'], param['month'], param['day'])
revision   = param['revision']
log_text   = param['log_text']
table      = 'daily_log_' + experiment

but it has problems with some text, specifically the & symbol. I think 
this may be because I'm not using a real form in the request. Has anyone 
had any experience with this type of thing?

Any help or suggestions would be appreciated. Thanks.

David

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to