All pastes #366015 Raw Edit

Anonymous

public cpp v1 · immutable
#366015 ·published 2007-02-21 12:56 UTC
rendered paste body
void MainWindow::newPostMessage(){    QString strIn = LineCommand->displayText() ;    strIn.replace("&", "%26") ;    QString MESSFMT = "message=%s&section=1";      QUrl::toPercentEncoding(strIn);    MESSFMT.replace("%s", "%1");    strIn = QString(MESSFMT).arg(strIn);        QUrl url(ADD);    httppost->setHost(url.host(), url.port() != -1 ? url.port() : 80);        httpRequestPostAborted = false;        QHttpRequestHeader header("POST", url.path());    header.setValue("Host", url.host());    header.setContentType("application/x-www-form-urlencoded");    header.setValue("User-Agent", UA);        header.setValue( "Cookie", GATAL);     if ( ENCODAGE == "iso-8859-1" or ENCODAGE == "iso-8859-15")    {        qDebug("Latin1");                httpPostId = httppost->request(header, strIn.toLatin1());    }    else    {                qDebug("utf8");        httpPostId = httppost->request(header, strIn.toUtf8());    }              OKButton->setEnabled(false);              }