|
| virtual | ~ApiBase () |
| | Destructor for ApiBase.
|
| |
| virtual QUrl | url () const =0 |
| |
| virtual QLocale | locale () const |
| | Returns the api locale.
|
| |
| void | head (const Request &request, const ApiRunCallback &callback) |
| | Makes a HEAD request and calls the provided callback upon completion.
|
| |
| Response * | head (const Request &request) |
| | Makes a HEAD request and returns the Response object.
|
| |
| void | get (const Request &request, const ApiRunCallback &callback) |
| | Makes a GET request and calls the provided callback upon completion.
|
| |
| Response * | get (const Request &request) |
| | Makes a GET request and returns the Response object.
|
| |
| void | post (const Request &request, const Body &body, const ApiRunCallback &callback) |
| | Makes a POST request with a body and calls the provided callback upon completion.
|
| |
| Response * | post (const Request &request, const Body &body) |
| | Makes a POST request with a body and returns the Response object.
|
| |
| void | put (const Request &request, const Body &body, const ApiRunCallback &callback) |
| | Makes a PUT request with a body and calls the provided callback upon completion.
|
| |
| Response * | put (const Request &request, const Body &body) |
| | Makes a PUT request with a body and returns the Response object.
|
| |
| void | patch (const Request &request, const Body &body, const ApiRunCallback &callback) |
| | Makes a PATCH request with a body and calls the provided callback upon completion.
|
| |
| Response * | patch (const Request &request, const Body &body) |
| | Makes a PATCH request with a body and returns the Response object.
|
| |
| void | deleteResource (const Request &request, const ApiRunCallback &callback) |
| | Makes a DELETE request and calls the provided callback upon completion.
|
| |
| Response * | deleteResource (const Request &request) |
| | Makes a DELETE request and returns the Response object.
|
| |
| virtual Response * | send (AbstractRequestHandler::Method method, const Request &request, const Body &body) |
| |
| virtual QString | userAgent () const |
| | Returns the user agent string for the API.
|
| |
| NetworkManager * | networkManager () const |
| | Returns the network manager used by the ApiBase class.
|
| |
| void | setNetworkManager (NetworkManager *manager) |
| | Sets the network manager for the ApiBase class.
|
| |
| bool | hasPathParameter (const QString &name) const |
| | Checks if a path parameter exists in the request.
|
| |
| PathParameter | pathParameter (const QString &name) const |
| | Retrieves a specific path parameter.
|
| |
| QVariant | pathParameterValue (const QString &name) const |
| | Retrieves the value of a path parameter.
|
| |
| QStringList | pathParameterNames () const |
| | Retrieves the names of all path parameters.
|
| |
| void | setPathParameter (const QString &name, const QVariant &value) |
| | Sets the value of a path parameter.
|
| |
| void | setPathParameter (const PathParameter ¶meter) |
| | Sets a path parameter using a PathParameter object.
|
| |
| void | unsetPathParameter (const QString &name) |
| | Unsets (removes) a path parameter from the request.
|
| |
| QList< PathParameter > | pathParameters () const |
| | Retrieves all path parameters.
|
| |
| void | setPathParameters (const QList< PathParameter > ¶meters) |
| | Sets all path parameters.
|
| |
| bool | hasQueryParameter (const QString &name) const |
| | Checks if a query parameter exists in the request.
|
| |
| QueryParameter | queryParameter (const QString &name) const |
| | Retrieves a specific query parameter.
|
| |
| QList< QVariant > | queryParameterValues (const QString &name) const |
| | Retrieves the values of a query parameter.
|
| |
| QStringList | queryParameterNames () const |
| | Retrieves the names of all query parameters.
|
| |
| void | addQueryParameter (const QString &name, const QVariant &value) |
| | Add the value of a query parameter.
|
| |
| void | addQueryParameter (const QueryParameter ¶m) |
| | Add query parameter using a QueryParameter object.
|
| |
| void | removeQueryParameter (const QString &name) |
| | Removes a query parameter from the request.
|
| |
| void | removeQueryParameter (const QString &name, const QVariant &value) |
| | Removes a query parameter from the request.
|
| |
| QList< QueryParameter > | queryParameters () const |
| | Retrieves all query parameters.
|
| |
| void | setQueryParameters (const QList< QueryParameter > ¶meters) |
| | Sets all query parameters.
|
| |
| bool | hasHeader (const QString &name) const |
| | Checks if a header exists in the request.
|
| |
| Header | header (const QString &name) const |
| | Retrieves a specific header.
|
| |
| QList< QVariant > | headerValues (const QString &name) const |
| | Retrieves the values of a header.
|
| |
| QStringList | headerNames () const |
| | Retrieves the names of all headers.
|
| |
| void | setHeader (const QString &name, const QVariant &value) |
| | Sets the value of a header.
|
| |
| void | setHeader (const Header &header) |
| | Sets a header using a Header object.
|
| |
| void | unsetHeader (const QString &name) |
| | Unsets (removes) a header from the request.
|
| |
| QList< Header > | headers () const |
| | Retrieves all headers.
|
| |
| void | setHeaders (const QList< Header > &headers) |
| | Sets all headers.
|
| |
The ApiBase class provides methods for making HTTP requests (HEAD, GET, POST, PUT, PATCH, DELETE) and handling responses.
This class encapsulates the functionality for interacting with an API by providing methods for various HTTP methods. It manages request interceptors, constructs network requests, and handles the creation of network replies and responses. The class supports asynchronous communication, allowing the user to pass callbacks for handling responses.
- Note
- This class must not be used directly, use Api class instead.
- See also
- Request, Response, RequestInterceptor