forked from loafle/openapi-generator-original
[go] fix multipart for non-file inputs (#2792)
* [go] fix multipart for non-file inputs * update relevant sample client
This commit is contained in:
committed by
William Cheng
parent
ee43cc1520
commit
f2b1f770f8
@@ -218,10 +218,11 @@ func (c *APIClient) prepareRequest(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
}
|
||||
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
w.Close()
|
||||
|
||||
@@ -229,10 +229,11 @@ func (c *APIClient) prepareRequest(
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
}
|
||||
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
w.Close()
|
||||
|
||||
Reference in New Issue
Block a user