Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 4.8.2 QWebView getting Content-type missing in HTTP POST, defaulting to application/octet-stream

Qt 4.8.2 QWebView getting Content-type missing in HTTP POST, defaulting to application/octet-stream

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    umen242
    wrote on last edited by
    #1

    i have popup window that is opened from web page ( its paypal popup)
    i capture it and then i try to fix this error as the document suggesting here "Your text to link here...":http://qt-project.org/doc/note_revisions/84/125/view
    but still im getting this error
    here is my QWebView class

    @ class WebView : public QWebView
    {
    Q_OBJECT
    public:
    WebView()
    {
    connect( this->page()->networkAccessManager(),
    SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> & )),
    this,
    SLOT(sslErrorHandler(QNetworkReply*, const QList<QSslError> & )));
    }

    private slots:
        void sslErrorHandler( QNetworkReply *reply, const QList<QSslError> &errors)
        {
            qDebug() << "sslErrorHandler:";
            foreach (QSslError err, errors)
              qDebug() << "ssl error: " << err;
    
            reply->ignoreSslErrors();
        }
    
    protected:
        QWebView *createWindow(QWebPage::WebWindowType type)
        {
            QWebView *webview = new QWebView;
             
      QUrl tmpUrl = webview->url(); 
      QNetworkRequest request(tmpUrl);
      //request.setHeader(QNetworkRequest::ContentTypeHeader,QVariant("application/x-www-form-urlencoded"));
      request.setHeader(QNetworkRequest::ContentTypeHeader,"application/octet-stream");
      
            //webview->show();
      webview->load(request,QNetworkAccessManager::PostOperation);
            return webview;
        }
    };
    

    @

    what im doing wrong here ?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexisdm
      wrote on last edited by
      #2

      You don't need to load anything in createWindow, just create the QWebView, show it, and return it.

      1 Reply Last reply
      0
      • U Offline
        U Offline
        umen242
        wrote on last edited by
        #3

        yes but i try to avoid this error somehow

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved