mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-09-04 01:42:44 +00:00
Refractor ApiClient and add support for body params
ApiClient was refractored to use PIMPL. This is mainly done to reduce compile times whenever the implementation of ApiClient itself changes, since a lot of files include it. The loaders have gained support for body parameters, this was somehow omitted before.
This commit is contained in:
parent
1453cbbc63
commit
96ecd8e7d8
116 changed files with 4437 additions and 106 deletions
|
@ -35,5 +35,23 @@ QUrlQuery {{e.className}}Loader::query(const {{e.endpoint.parameterType}} ¶m
|
|||
return result;
|
||||
}
|
||||
|
||||
QByteArray {{e.className}}Loader::body(const {{e.endpoint.parameterType}} ¶ms) const {
|
||||
|
||||
{{#if e.endpoint.bodyParameters.length == 1}}
|
||||
return Support::toString<{{e.endpoint.bodyParameters[0].type.typeNameWithQualifiers}}>(params.body()).toUtf8();
|
||||
|
||||
{{else}}
|
||||
return QByteArray();
|
||||
|
||||
{{/if}}
|
||||
}
|
||||
|
||||
QNetworkAccessManager::Operation {{e.className}}Loader::operation() const {
|
||||
// HTTP method {{e.operation}}
|
||||
|
||||
return QNetworkAccessManager::{{e.operation}}Operation;
|
||||
|
||||
}
|
||||
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue