forked from loafle/openapi-generator-original
Update api_client.nustache
This commit is contained in:
@@ -36,6 +36,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient {
|
||||
|
||||
$Configuration = Get-{{{apiNamePrefix}}}Configuration
|
||||
$RequestUri = $Configuration["BaseUrl"] + $Uri
|
||||
$DefaultHeaders = $Configuration["DefaultHeaders"]
|
||||
# should make sure that SkipCertificateCheck is not set for PowerShell 5
|
||||
$SkipCertificateCheck = $Configuration["SkipCertificateCheck"]
|
||||
$Proxy = $Configuration["Proxy"]
|
||||
@@ -59,7 +60,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient {
|
||||
}
|
||||
|
||||
# Content-Type and multipart handling
|
||||
$ContentType= SelectHeaders -Headers $ContentTypes
|
||||
$ContentType = SelectHeaders -Headers $ContentTypes
|
||||
if ($ContentType) {
|
||||
$HeaderParameters['Content-Type'] = $ContentType
|
||||
if ($ContentType -eq 'multipart/form-data') {
|
||||
@@ -68,7 +69,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient {
|
||||
}
|
||||
|
||||
# add default headers if any
|
||||
foreach ($header in $Configuration["DefaultHeaders"].GetEnumerator()) {
|
||||
foreach ($header in $DefaultHeaders.GetEnumerator()) {
|
||||
$HeaderParameters[$header.Name] = $header.Value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user