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)
Trying to match http://nodejs.org/docs/latest/api/http.html.
For the server response:
* Change writeBody to write
* Change writeHeaders to writeHead
For the request object, 'headers' is now an object containing all
key-value pairs of the actual HTTP headers.
'queryString' is folded into 'url' key.
Non-standard keys in the request: isSSL, remotePort, remoteIP,
remoteUser, are disabled in the mean-time (will be revisited after 1.4
release).
Implementation-wise, the request object is now a simple key-value pair
using QVariant, as opposed to the heavy QObject instance.
http://code.google.com/p/phantomjs/issues/detail?id=115
this is the minimal server that gets properly embedded into
the phantomjs space but the .listen api is missing actually
useful options (incoming request and ability to write to client)