Merge pull request #112 from yunify/add-post-header

add header to send right post request
This commit is contained in:
Simon 2018-09-20 14:27:55 +08:00 committed by GitHub
commit 3692eebc9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,9 @@ func (b *Builder) build() (*http.Request, error) {
if err != nil {
return nil, err
}
if b.operation.RequestMethod == "POST"{
httpRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded")
}
logger.Info(fmt.Sprintf(
"Built QingCloud request: [%d] %s \n %s ",