Uploading data to Tumblr API
I've been at this issue for a while and just cannot solve the issue. Using the HTTP POST Method, I wish to send images or audio files to Tumblr. I always seem to get 403 - Bad Request issue when doing this. Sending text is no issue.
Code below is what I'm using:
@void Control::uploadPhoto(QString stringy)
qDebug() << stringy;
songArray = file.readAll();
arrayPost = url1.encodedQuery();
reply3 = manager.post(request, songArray);
connect(reply3, SIGNAL(metaDataChanged()), this, SLOT(errorCheck()));
Any help with this will be greatly appreciated. I have spent a very long time attempting to solve this issue.--
Thanks in advance,
Did you check the output of url1.encodedQuery() ?
It appears to be fine. Everything seems ok before the data is sent.
Thanks for the help.
I'm not 100% sure, but as far as I remember, QNetworkRequest does not support file upload out of the box. You will have to prepare the data (wrapping into MIME headers etc.) yourself.