|
RestLink 2.2.0
Powerfull Rest Client for Qt
|
#include <serverresponse.h>
Inherits RestLink::Response.
Public Slots | |
| void | updateDownloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
| void | updateUploadProgress (qint64 bytesSent, qint64 bytesTotal) |
| void | complete () |
| void | ignoreSslErrors () override |
| void | abort () override |
Public Slots inherited from RestLink::Response | |
| virtual void | ignoreSslErrors () |
| virtual void | abort ()=0 |
Public Member Functions | |
| ServerResponse (Server *server) | |
| AbstractRequestHandler::Method | method () const override |
| void | setMethod (AbstractRequestHandler::Method method) |
| bool | isFinished () const override |
| Checks if the request has finished processing. | |
| int | httpStatusCode () const override |
| void | setHttpStatusCode (int code) |
| bool | hasHeader (const QByteArray &name) const override |
| Checks if the response contains a specific header. | |
| QByteArray | header (const QByteArray &name) const override |
| Retrieves the value of a specific header. | |
| QByteArrayList | headerList () const override |
| void | setHeaders (const QList< Header > &headers) |
| QJsonObject | readJsonObject (QJsonParseError *error) override |
| Reads the response body as a JSON object. | |
| QJsonArray | readJsonArray (QJsonParseError *error) override |
| Reads the response body as a JSON array. | |
| QJsonValue | readJson (QJsonParseError *error) override |
| Reads the response body as a JSON value. | |
| QString | readString () override |
| Reads the response body as a QString. | |
| QByteArray | readBody () override |
| Reads the raw response body as a QByteArray. | |
| void | setBody (const Body &body) |
| QNetworkRequest | networkRequest () const override |
| Retrieves the network request used in this response. | |
| void | setNetworkRequest (const QNetworkRequest &request) |
| QNetworkReply * | networkReply () const override |
| Server * | server () const |
Public Member Functions inherited from RestLink::Response | |
| virtual | ~Response () |
| Destructor for Response. | |
| QString | endpoint () const |
| Retrieves the API endpoint associated with this response. | |
| Request | request () const |
| Retrieves the API request associated with this response. | |
| Api * | api () const |
| Retrieves the API instance associated with this response. | |
| QUrl | url () const |
| Retrieves the URL associated with this response. | |
| bool | isRunning () const |
| Checks if the request is currently running. | |
| bool | isSuccess () const |
| Checks if the request was successful. | |
| bool | isHttpStatusSuccess () const |
| Checks if the HTTP status code indicates success. | |
| bool | hasHttpStatusCode () const |
| Checks if the HTTP status code is valid. | |
| virtual QString | httpReasonPhrase () const |
| bool | hasNetworkError () const |
| virtual int | networkError () const |
| Retrieves the network error code. | |
| virtual QString | networkErrorString () const |
| Retrieves a string description of the network error. | |
Public Member Functions inherited from RestLink::ResponseBase | |
| ResponseBase (QObject *parent=nullptr) | |
| virtual | ~ResponseBase () |
| bool | isSequential () const override |
| bool | open (OpenMode mode) override |
| void | close () override |
| qint64 | pos () const override |
| qint64 | size () const override |
| bool | seek (qint64 pos) override |
| bool | atEnd () const override |
| bool | reset () override |
| qint64 | bytesAvailable () const override |
| qint64 | bytesToWrite () const override |
| bool | canReadLine () const override |
| bool | waitForReadyRead (int msecs) override |
| bool | waitForBytesWritten (int msecs) override |
| QIODevice * | responseDevice () const |
Additional Inherited Members | |
Signals inherited from RestLink::Response | |
| void | downloadProgress (qint64 bytesReceived, qint64 bytesTotal) |
| void | uploadProgress (qint64 bytesSent, qint64 bytesTotal) |
| void | networkErrorOccured (int error) |
| void | finished () |
| void | sslErrorsOccured (const QList< QSslError > &errors) |
Protected Member Functions inherited from RestLink::Response | |
| Response (ResponsePrivate *d, QObject *parent) | |
| void | setRequest (const Request &request) |
| QByteArray | body () |
Protected Member Functions inherited from RestLink::ResponseBase | |
| qint64 | readData (char *data, qint64 maxlen) override |
| qint64 | readLineData (char *data, qint64 maxlen) override |
| qint64 | skipData (qint64 maxSize) override |
| qint64 | writeData (const char *data, qint64 len) override |
| void | setResponseDevice (QIODevice *device) |
Protected Attributes inherited from RestLink::Response | |
| QScopedPointer< ResponsePrivate > | d_ptr |
Properties inherited from RestLink::Response | |
| QString | endpoint |
| int | method |
| Retrieves the HTTP method type for this response. | |
| QUrl | url |
| bool | running |
| bool | finished |
| bool | success |
| bool | hasHttpStatusCode |
| int | httpStatusCode |
| Retrieves the HTTP status code of the response. | |
| QString | httpReasonPhrase |
| Retrieves the HTTP reason phrase of the response. | |
| QByteArrayList | headerList |
| Retrieves a list of all headers in the response. | |
| bool | hasNetworkError |
| Checks if a network error occurred during the request. | |
| int | networkError |
| QString | networkErrorString |
| QByteArray | body |
|
explicit |
|
overridevirtual |
Implements RestLink::Response.
| void RestLink::ServerResponse::setMethod | ( | AbstractRequestHandler::Method | method | ) |
|
overridevirtual |
Checks if the request has finished processing.
true if the request is finished, otherwise false. Implements RestLink::Response.
|
overridevirtual |
Implements RestLink::Response.
| void RestLink::ServerResponse::setHttpStatusCode | ( | int | code | ) |
|
overridevirtual |
Checks if the response contains a specific header.
| name | The name of the header to check. |
true if the header is present, otherwise false. Reimplemented from RestLink::Response.
|
overridevirtual |
Retrieves the value of a specific header.
| header | The name of the header to retrieve. |
Implements RestLink::Response.
|
overridevirtual |
Implements RestLink::Response.
| void RestLink::ServerResponse::setHeaders | ( | const QList< Header > & | headers | ) |
|
overridevirtual |
Reads the response body as a JSON object.
| error | An optional pointer to a QJsonParseError to capture any parsing errors. |
Reimplemented from RestLink::ResponseBase.
|
overridevirtual |
Reads the response body as a JSON array.
| error | An optional pointer to a QJsonParseError to capture any parsing errors. |
Reimplemented from RestLink::ResponseBase.
|
overridevirtual |
Reads the response body as a JSON value.
| error | An optional pointer to a QJsonParseError to capture any parsing errors. |
Reimplemented from RestLink::ResponseBase.
|
overridevirtual |
Reads the response body as a QString.
Reimplemented from RestLink::ResponseBase.
|
overridevirtual |
Reads the raw response body as a QByteArray.
Reimplemented from RestLink::ResponseBase.
| void RestLink::ServerResponse::setBody | ( | const Body & | body | ) |
|
overridevirtual |
Retrieves the network request used in this response.
Implements RestLink::Response.
| void RestLink::ServerResponse::setNetworkRequest | ( | const QNetworkRequest & | request | ) |
|
overridevirtual |
Implements RestLink::Response.
| Server * RestLink::ServerResponse::server | ( | ) | const |
|
slot |
|
slot |
|
slot |
|
overrideslot |
|
overrideslot |