ariya/phantomjs — pull request #205 by milianw (2012-02-15 12:58:40+00:00)
Title: WebServer: Data access (POST/PUT)

For POST and PUT request we now read all data as defined by
the Content-Length header into request.rawData property.
This property is a QByteArray which neatly maps to an array
in javascript.

For POST requests with Content-Type = applicaiton/x-www-form-urlencoded
we furthermore provide a parsed, easy-to-use request.post property.
This one is a QVariantMap of the decoded form data.

There is a new postserver.js example that shows the usage.

The unit test is extended to test the new (and old) features
of the server.

TODO: test that verifies proper decoding of UTF8 data, which
is not yet possible since I see no way to do a post-request
using phantomjs with an explicitly defined charset

ISSUE: 340 (http://code.google.com/p/phantomjs/issues/detail?id=340)

NOTE: I have no idea how to exclude the commit from https://github.com/ariya/phantomjs/pull/202 from this pull request, I'm sorry.

NOTE2: I finally figured out the webserver-spec issue, apparently one must not nest it() tests, which is done if one uses expectHasFunction or expectHasProperty (which I did in the webserver callback). Anyhow, now the test works as one would expect, nice!