forked from loafle/openapi-generator-original
Merge pull request #6067 from swagger-api/issue-5006
expose default headers, add headers to request
This commit is contained in:
commit
ff04f532bb
@ -112,9 +112,15 @@ void
|
|||||||
{{/isContainer}}{{/bodyParams}}
|
{{/isContainer}}{{/bodyParams}}
|
||||||
|
|
||||||
{{#headerParams}}
|
{{#headerParams}}
|
||||||
// TODO: add header support
|
if ({{paramName}} != nullptr) {
|
||||||
|
input.headers.insert("{{baseName}}", "{{paramName}}");
|
||||||
|
}
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
|
|
||||||
|
foreach(QString key, this->defaultHeaders.keys()) {
|
||||||
|
input.headers.insert(key, this->defaultHeaders.value(key));
|
||||||
|
}
|
||||||
|
|
||||||
connect(worker,
|
connect(worker,
|
||||||
&HttpRequestWorker::on_execution_finished,
|
&HttpRequestWorker::on_execution_finished,
|
||||||
this,
|
this,
|
||||||
|
@ -23,6 +23,7 @@ public:
|
|||||||
|
|
||||||
QString host;
|
QString host;
|
||||||
QString basePath;
|
QString basePath;
|
||||||
|
QMap<QString, QString> defaultHeaders;
|
||||||
|
|
||||||
{{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
{{#operations}}{{#operation}}void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});
|
||||||
{{/operation}}{{/operations}}
|
{{/operation}}{{/operations}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user