Is your feature request related to a problem? Please describe.
Currently the accept header is forced to XML for ExecuteRequest() and other methods, but some API (like the /cloudapi) only accepts json
|
func (client *Client) ExecuteRequest(pathURL, requestType, contentType, errorMessage string, payload, out interface{}) (*http.Response, error) { |
|
return client.executeRequest(pathURL, requestType, contentType, errorMessage, payload, out, client.APIVersion) |
|
} |
This is forced here:
|
req.Header.Add("Accept", "application/*+xml;version="+apiVersion) |
Describe the solution you'd like
If the content-type parameter is set to something json, it should automatically change the accept to JSON instead of XML
Describe alternatives you've considered
You need to reimplement the logic yourself
Additional context
No response
Is your feature request related to a problem? Please describe.
Currently the accept header is forced to XML for
ExecuteRequest()and other methods, but some API (like the /cloudapi) only accepts jsongo-vcloud-director/govcd/api.go
Lines 558 to 560 in 8dbe510
This is forced here:
go-vcloud-director/govcd/api.go
Line 253 in 8dbe510
Describe the solution you'd like
If the content-type parameter is set to something json, it should automatically change the accept to JSON instead of XML
Describe alternatives you've considered
You need to reimplement the logic yourself
Additional context
No response