C
C
click_f2016-05-14 18:39:23
Qt
click_f, 2016-05-14 18:39:23

How to get Header via QNetworkAccessManager?

I'm trying to parse an example program for capturing header'a. Due to the fact that the QHttp library is outdated, I use QNetworkAccessManager.

  • What is the equivalent of QHttpResponseHeader from QHttp ?
  • How to get the title in another way and where exactly to look in the documentation so as not to ask such questions in the future?
// downloader.h

#ifndef DOWNLOADER_H
#define DOWNLOADER_H

#include <QObject>
#include <QHttp>// заменил на <QNetworkAccessManager>
#include <QFile>
#include <QDebug>


class downloader : public QObject
{
    Q_OBJECT
public:
    explicit downloader(QObject *parent = 0);

    void Do_Download();

signals:

public slots:
    void stateChanged(int state);
    void responseHeaderReceived ( const QHttpResponseHeader & resp ); //Ошибка тут
    void requestFinished ( int id, bool error );

private:
    QHttp *http;

};
#endif // DOWNLOADER_H

Thanks for any advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2016-05-14
@click_f

https://www.google.ru/search?q=qnetworkaccessmanag...
The third link in the search results shows how to work with the received headers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question