QDailymotion
A Qt/C++ library and QML module to access the Dailymotion Data API.
 All Classes Functions Enumerations Properties Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Properties | List of all members
QDailymotion::Request Class Reference

The base class for making requests to the Dailymotion Data API. More...

Inheritance diagram for QDailymotion::Request:
QDailymotion::AuthenticationRequest QDailymotion::ResourcesRequest QDailymotion::StreamsRequest

Public Types

enum  Operation
 The operation type of the last HTTP request. More...
enum  Status
 The status of the last HTTP request. More...
enum  Error
 The error resulting from the last HTTP request. More...

Public Slots

void cancel ()
 Cancels the current HTTP request.

Signals

void clientIdChanged ()
 Emitted when the clientId changes.
void clientSecretChanged ()
 Emitted when the clientSecret changes.
void accessTokenChanged (const QString &token)
 Emitted when the accessToken changes.
void refreshTokenChanged (const QString &token)
 Emitted when the refreshToken changes.
void urlChanged ()
 Emitted when the url changes.
void dataChanged ()
 Emitted when the data changes.
void headersChanged ()
 Emitted when the headers change.
void operationChanged ()
 Emitted when the operation changes.
void statusChanged (Status s)
 Emitted when the status changes.
void finished ()
 Emitted when the request is completed.

Public Member Functions

void setNetworkAccessManager (QNetworkAccessManager *manager)
 Sets the QNetworkAccessManager instance to be used when making requests to the Dailymotion API.

Protected Slots

void head (bool authRequired=true)
 Performs a HTTP HEAD request.
void get (bool authRequired=true)
 Performs a HTTP GET request.
void post (bool authRequired=true)
 Performs a HTTP POST request.
void put (bool authRequired=true)
 Performs a HTTP PUT request.
void deleteResource (bool authRequired=true)
 Performs a HTTP DELETE request.

Properties

QString clientId
 The client id used when making requests to the Dailymotion Data API.
QString clientSecret
 The api key used when making requests to the Dailymotion Data API.
QString accessToken
 The access token used when making requests to the Dailymotion Data API.
QString refreshToken
 The refresh token used when making requests to the Dailymotion Data API.
QUrl url
 The url used when making requests to the Dailymotion Data API.
QVariantMap headers
 The headers used when making requests to the Dailymotion Data API.
QVariant data
 The data used when making HTTP PUT/POST requests to the Dailymotion Data API.
Operation operation
 The last HTTP operation type.
Status status
 The status of the last request.
QVariant result
 The result of the last HTTP request.
Error error
 The error resulting from the last HTTP request.
QString errorString
 A description of the error resulting from the last HTTP request.

Detailed Description

The base class for making requests to the Dailymotion Data API.

Normally, there should be no need to use this class, but it can be useful if you need to extend the range of API requests beyond those provided in the existing subclasses.

Member Enumeration Documentation

The error resulting from the last HTTP request.

Can be one of the folowing:

Value Description
NoError No error condition.
ConnectionRefusedError The remote server refused the connection (the server is not accepting requests).
HostNotFoundError The remote host name was not found (invalid hostname).
TimeoutError The connection to the remote server timed out.
SslHandshakeFailedError The SSL/TLS handshake failed and the encrypted channel could not be established.
TemporaryNetworkFailureError The connection was broken due to disconnection from the network, however the system has initiated roaming to another access point.
ProxyConnectionRefusedError The proxy server closed the connection prematurely, before the entire reply was received and processed.
ProxyConnectionClosedError The proxy server closed the connection prematurely, before the entire reply was received and processed.
ProxyNotFoundError The proxy host name was not found (invalid proxy hostname).
ProxyTimeoutError The connection to the proxy timed out or the proxy did not reply in time to the request sent.
ProxyAuthenticationRequiredError The proxy requires authentication in order to honour the request but did not accept any credentials offered (if any).
ContentAccessDenied The access to the remote content was denied (similar to HTTP error 401).
ContentOperationNotPermittedError The operation requested on the remote content is not permitted.
ContentNotFoundError The remote content was not found at the server (similar to HTTP error 404).
AuthenticationRequiredError The remote server requires authentication to serve the content but the credentials provided were not accepted (if any).
ContentReSendError The request needed to be sent again, but this failed for example because the upload data could not be read a second time.
ProtocolUnknownError The Network Access API cannot honor the request because the protocol is not known.
ProtocolInvalidOperationError The requested operation is invalid for this protocol.
UnknownNetworkError An unknown network-related error was detected.
UnknownProxyError An unknown proxy-related error was detected.
UnknownContentError An unknown error related to the remote content was detected.
ProtocolFailure A breakdown in protocol was detected (parsing error, invalid or unexpected responses, etc.).
ParseError There was an error in parsing the server response.

The operation type of the last HTTP request.

Can be one of the following:

Value Description
HeadOperation Retrieve headers(created with head()).
GetOperation Retrieve headers and download contents (created with get()).
PutOperation Upload contents operation (created with put()).
PostOperation Send the contents of an HTML form for processing via HTTP POST (created with post()).
DeleteOperation Send the contents of an HTML form for processing via HTTP POST (created with post()).

The status of the last HTTP request.

Can be one of the following:

Value Description
Null No request has been made.
Loading A request is in progress.
Canceled The last request was canceled.
Failed The last request failed.
Ready The last request was successful.

Member Function Documentation

void QDailymotion::Request::finished ( )
signal

Emitted when the request is completed.

See Also
status, result
void QDailymotion::Request::setNetworkAccessManager ( QNetworkAccessManager *  manager)

Sets the QNetworkAccessManager instance to be used when making requests to the Dailymotion API.

Request does not take ownership of manager.

If no QNetworkAccessManager is set, one will be created when required.