1
0
Fork 0
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:
Chris Josten 2021-09-03 03:47:25 +02:00
parent 1453cbbc63
commit 96ecd8e7d8
116 changed files with 4437 additions and 106 deletions

View file

@ -35,5 +35,23 @@ QUrlQuery {{e.className}}Loader::query(const {{e.endpoint.parameterType}} &param
return result;
}
QByteArray {{e.className}}Loader::body(const {{e.endpoint.parameterType}} &params) 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}}