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
Forum Updated to NodeBB v4.3 + New Features

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.7k Views 1 Watching
  • 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 20 Jun 2013, 22:20 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 20 Jun 2013, 22:46 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 21 Jun 2013, 05:14 last edited by
        #3

        yes but i try to avoid this error somehow

        1 Reply Last reply
        0

        3/3

        21 Jun 2013, 05:14

        • Login

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