[Qt-interest] Problem using URL with special characters
kent williams
nkwmailinglists at gmail.com
Fri Aug 26 23:07:26 CEST 2011
I am using the REST API to update a field in a database on a server. I
don't have any control over what the backend does so I can't change
the URL I use to post to the server:
If I do this, the operation works -- it sets the 'Reviewed' field:
curl --globoff -u williamsnk -X PUT
'https://predict-hd.net/xnat/REST/projects/FMRI_HD_024/subjects/0252/experiments/45602/scans/2?xnat:mrScanData/parameters/addParam[name%3DReviewed]/addfield=Yes'
Note that there are square brackets, %3D (an encoded '=' -- this is
required with this particular REST request).
If -- as I've been doing -- I use QNetworkAccessManager to access the
server, so far I've done OK using the defaults behavior for QUrl when
I set up a request like this. But this URL above doesn't work with
QNetworkAccessManager, and it does with curl.
So I'm guessing the problem is that that the QUrl encoding is garbling
my URL. If I call toEncoded() I get this:
https://predict-hd.net/xnat/REST/projects/FMRI_HD_024/subjects/0252/experiments/45602/scans/2?xnat:mrScanData/parameters/addParam%5Bname%253DReviewed%5D/addfield=Yes
In particular it's replacing my square brackets, and garbling the %3D
(encoded '=')
I'm new to using Qt in this way and I'm baffled as to how to get to
NOT screw up my URL. Any ideas?
More information about the Qt-interest-old
mailing list