emental86
27th March 2009, 11:08
Hello,
variables from GET method I get without problem
}else if (httpHeader->method() == "GET"){
QUrl* url = new QUrl(httpHeader->path());
QList< QPair<QString, QString> > params = url->queryItems();
QMap<QString, QString> paramsMap;
for(int i=0; i<params.size(); i++){
paramsMap[params[i].first] = params[i].second;
}
...
I can work with variables like this: paramsMap["name"]
But I need use the POST method? How I get variables? Help please...
I can only get this:
user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
accept-language: en-us,en;q=0.5
accept-encoding: gzip,deflate
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive: 300
connection: keep-alive
by
if(httpHeader->method() == "POST"){
QUrl* url = new QUrl(httpHeader->path());
QList< QPair<QString, QString> > params = httpHeader->values();
for(int i=0; i<params.size(); i++){
out << params[i].first << ": " << params[i].second << endl;
}
...
variables from GET method I get without problem
}else if (httpHeader->method() == "GET"){
QUrl* url = new QUrl(httpHeader->path());
QList< QPair<QString, QString> > params = url->queryItems();
QMap<QString, QString> paramsMap;
for(int i=0; i<params.size(); i++){
paramsMap[params[i].first] = params[i].second;
}
...
I can work with variables like this: paramsMap["name"]
But I need use the POST method? How I get variables? Help please...
I can only get this:
user-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
accept-language: en-us,en;q=0.5
accept-encoding: gzip,deflate
accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive: 300
connection: keep-alive
by
if(httpHeader->method() == "POST"){
QUrl* url = new QUrl(httpHeader->path());
QList< QPair<QString, QString> > params = httpHeader->values();
for(int i=0; i<params.size(); i++){
out << params[i].first << ": " << params[i].second << endl;
}
...