[go] fix multipart for non-file inputs (#2792)

* [go] fix multipart for non-file inputs

* update relevant sample client
This commit is contained in:
Thiago Arrais
2019-05-08 00:19:06 -03:00
committed by William Cheng
parent ee43cc1520
commit f2b1f770f8
2 changed files with 6 additions and 4 deletions

View File

@@ -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()

View File

@@ -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()