#include <httpcomms.h>
Definition at line 11 of file httpcomms.h.
Public Types | |
| enum | CredentialTypes { CRED_WEB, CRED_PROXY } |
Public Member Functions | |
| HttpComms () | |
| HttpComms (QUrl &url, int timeoutms=-1) | |
| HttpComms (QUrl &url, QHttpRequestHeader &header, int timeoutms=-1) | |
| virtual | ~HttpComms () |
| bool | isDone (void) |
| int | getProgress (void) |
| int | getTotal (void) |
| int | getStatusCode (void) |
| QString | getResponseReason (void) |
| QString | getData (void) |
| QByteArray | getRawData (void) |
| QString | getRedirectedURL (void) |
| void | stop () |
| bool | isTimedout (void) |
| void | setCredentials (const Credentials &cred, int credType) |
| void | request (QUrl &url, int timeoutms=-1, bool allowGzip=false) |
| void | request (QUrl &url, QHttpRequestHeader &header, int timeoutms=-1, QIODevice *pData=NULL) |
| void | setCookie (const QString &cookie) |
| const QString & | getCookie () const |
Static Public Member Functions | |
| static QString | getHttp (QString &url, int timeoutMS=10000, int maxRetries=3, int maxRedirects=3, bool allowGzip=false, Credentials *webCred=NULL, bool isInQtEventThread=true) |
| Static function for grabbing http data for a url. | |
| static bool | getHttpFile (const QString &file, QString &url, int timeoutMS=10000, int maxRetries=3, int maxRedirects=3, bool allowGzip=false, Credentials *webCred=NULL) |
| static QString | postHttp (QUrl &url, QHttpRequestHeader *pAddlHdr=NULL, QIODevice *pData=NULL, int timeoutMS=10000, int maxRetries=3, int maxRedirects=3, bool allowGzip=false, Credentials *webCred=NULL, bool isInQtEventThread=true) |
| Static function for performing an http post request to a url. | |
Protected Member Functions | |
| void | init () |
| void | calculateDigestResponse (DigestAuthInfo &info, QCString &Response) |
| bool | createDigestAuth (bool isForProxy, const QString &authStr, QHttpRequestHeader *request) |
Private Slots | |
| void | timeout () |
| void | done (bool error) |
| void | stateChanged (int state) |
| void | dataReadProgress (int done, int total) |
| void | headerReceived (const QHttpResponseHeader &resp) |
Private Attributes | |
| int | m_statusCode |
| QString | m_redirectedURL |
| QString | m_responseReason |
| Credentials | m_webCredentials |
| Credentials | m_proxyCredentials |
| QHttp * | http |
| bool | m_done |
| QByteArray | m_data |
| QUrl | m_url |
| QTimer * | m_timer |
| bool | m_timeout |
| bool | m_authNeeded |
| int | m_timeoutInterval |
| QString | m_cookie |
| int | m_progress |
| int | m_total |
| QHttpRequestHeader | m_curRequest |
Classes | |
| class | Credentials |
| struct | DigestAuthInfo |
| HttpComms::HttpComms | ( | ) |
Definition at line 14 of file httpcomms.cpp.
| HttpComms::HttpComms | ( | QUrl & | url, | |
| int | timeoutms = -1 | |||
| ) |
Definition at line 21 of file httpcomms.cpp.
| HttpComms::HttpComms | ( | QUrl & | url, | |
| QHttpRequestHeader & | header, | |||
| int | timeoutms = -1 | |||
| ) |
Definition at line 28 of file httpcomms.cpp.
| HttpComms::~HttpComms | ( | ) | [virtual] |
Definition at line 34 of file httpcomms.cpp.
| bool HttpComms::isDone | ( | void | ) | [inline] |
Definition at line 20 of file httpcomms.h.
Referenced by getHttp(), MythNews::getHttpFile(), getHttpFile(), and postHttp().
| int HttpComms::getProgress | ( | void | ) | [inline] |
| int HttpComms::getTotal | ( | void | ) | [inline] |
| int HttpComms::getStatusCode | ( | void | ) | [inline] |
| QString HttpComms::getResponseReason | ( | void | ) | [inline] |
Definition at line 25 of file httpcomms.h.
| QString HttpComms::getData | ( | void | ) | [inline] |
| QByteArray HttpComms::getRawData | ( | void | ) | [inline] |
Definition at line 28 of file httpcomms.h.
Referenced by MythNews::getHttpFile(), and getHttpFile().
| QString HttpComms::getRedirectedURL | ( | void | ) | [inline] |
Definition at line 30 of file httpcomms.h.
Referenced by getHttp(), MythNews::getHttpFile(), getHttpFile(), and postHttp().
| void HttpComms::stop | ( | ) |
Definition at line 117 of file httpcomms.cpp.
| bool HttpComms::isTimedout | ( | void | ) | [inline] |
| void HttpComms::setCredentials | ( | const Credentials & | cred, | |
| int | credType | |||
| ) | [inline] |
| QString HttpComms::getHttp | ( | QString & | url, | |
| int | timeoutMS = 10000, |
|||
| int | maxRetries = 3, |
|||
| int | maxRedirects = 3, |
|||
| bool | allowGzip = false, |
|||
| Credentials * | webCred = NULL, |
|||
| bool | isInQtEventThread = true | |||
| ) | [static] |
Static function for grabbing http data for a url.
This is a synchronous function, it will block according to the vars.
Definition at line 279 of file httpcomms.cpp.
Referenced by IPTVChannelFetcher::DownloadPlaylist(), CdDecoder::lookupCDDB(), UPnpDeviceDesc::Retrieve(), and MythNews::slotViewArticle().
| bool HttpComms::getHttpFile | ( | const QString & | file, | |
| QString & | url, | |||
| int | timeoutMS = 10000, |
|||
| int | maxRetries = 3, |
|||
| int | maxRedirects = 3, |
|||
| bool | allowGzip = false, |
|||
| Credentials * | webCred = NULL | |||
| ) | [static] |
Definition at line 371 of file httpcomms.cpp.
Referenced by ImportIconsWizard::checkAndDownload(), MythNews::updateInfoView(), MythFlixQueue::updateInfoView(), and MythFlix::updateInfoView().
| QString HttpComms::postHttp | ( | QUrl & | url, | |
| QHttpRequestHeader * | pAddlHdr = NULL, |
|||
| QIODevice * | pData = NULL, |
|||
| int | timeoutMS = 10000, |
|||
| int | maxRetries = 3, |
|||
| int | maxRedirects = 3, |
|||
| bool | allowGzip = false, |
|||
| Credentials * | webCred = NULL, |
|||
| bool | isInQtEventThread = true | |||
| ) | [static] |
Static function for performing an http post request to a url.
This is a synchronous function, it will block according to the vars.
Definition at line 497 of file httpcomms.cpp.
Referenced by SOAPClient::SendSOAPRequest(), and ImportIconsWizard::wget().
| void HttpComms::request | ( | QUrl & | url, | |
| int | timeoutms = -1, |
|||
| bool | allowGzip = false | |||
| ) |
Definition at line 63 of file httpcomms.cpp.
Referenced by getHttp(), MythNews::getHttpFile(), getHttpFile(), HttpComms(), and postHttp().
| void HttpComms::request | ( | QUrl & | url, | |
| QHttpRequestHeader & | header, | |||
| int | timeoutms = -1, |
|||
| QIODevice * | pData = NULL | |||
| ) |
Definition at line 80 of file httpcomms.cpp.
| void HttpComms::setCookie | ( | const QString & | cookie | ) | [inline] |
Definition at line 78 of file httpcomms.h.
| const QString& HttpComms::getCookie | ( | ) | const [inline] |
Definition at line 79 of file httpcomms.h.
| void HttpComms::init | ( | ) | [protected] |
| void HttpComms::calculateDigestResponse | ( | DigestAuthInfo & | info, | |
| QCString & | Response | |||
| ) | [protected] |
| void HttpComms::timeout | ( | ) | [private, slot] |
| void HttpComms::done | ( | bool | error | ) | [private, slot] |
| void HttpComms::stateChanged | ( | int | state | ) | [private, slot] |
| void HttpComms::dataReadProgress | ( | int | done, | |
| int | total | |||
| ) | [private, slot] |
| void HttpComms::headerReceived | ( | const QHttpResponseHeader & | resp | ) | [private, slot] |
int HttpComms::m_statusCode [private] |
QString HttpComms::m_redirectedURL [private] |
QString HttpComms::m_responseReason [private] |
Credentials HttpComms::m_webCredentials [private] |
Credentials HttpComms::m_proxyCredentials [private] |
QHttp* HttpComms::http [private] |
Definition at line 115 of file httpcomms.h.
Referenced by done(), headerReceived(), init(), request(), stop(), and ~HttpComms().
bool HttpComms::m_done [private] |
QByteArray HttpComms::m_data [private] |
QUrl HttpComms::m_url [private] |
Definition at line 118 of file httpcomms.h.
Referenced by calculateDigestResponse(), createDigestAuth(), done(), request(), and timeout().
QTimer* HttpComms::m_timer [private] |
Definition at line 119 of file httpcomms.h.
Referenced by done(), headerReceived(), init(), request(), stop(), and ~HttpComms().
bool HttpComms::m_timeout [private] |
bool HttpComms::m_authNeeded [private] |
int HttpComms::m_timeoutInterval [private] |
QString HttpComms::m_cookie [private] |
int HttpComms::m_progress [private] |
int HttpComms::m_total [private] |
QHttpRequestHeader HttpComms::m_curRequest [private] |
1.5.5