You are not logged in.

1

Tuesday, September 20th 2011, 7:23am

Not acceptable error for request in http post method...

Hi, I am trying to use the http connection request response.. to connect it with my server....im trying to post the content which is in json format.... mt request hits the server but the response is as follows..

Server replied - not acceptable.

this is my code which i used to send request to the server.

QByteArray postData("");
QList<QPair<QByteArray, QByteArray> > headers;

if (!HttpCommunicator::splitIntoHeaders("application/json",
headers)) {
ui->m_textBrowserResp->setText(tr("Failed to parse HTTP headers."));
return;
}
HttpCommunicator::HttpRequestType requestType = HttpCommunicator::httpRequestTypeForText(
"POST");

m_httpCommunicator = new HttpCommunicator(requestType,"URl which i am posting",
"data which i want to post", headers, "True");

I can understand that the prob is because of the headers which i am passing... can anyone tell me wats the prob with these headers ???? wat i want to change to solve the problem... thanks for any replies..

This post has been edited 2 times, last edit by "juju" (Sep 21st 2011, 1:38pm)


2

Wednesday, September 21st 2011, 1:41pm

Any replies ill be appriciated.... :)

Similar threads