Skip to content

Commit

Permalink
Update createBasicXMLRequest
Browse files Browse the repository at this point in the history
If provided serialized XML, use it as is.
  • Loading branch information
ivahaev committed Nov 22, 2015
1 parent cea4ac3 commit 92b3359
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion request.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ func createFileUploadRequest(httpMethod, userURL string, ro *RequestOptions) (*h
func createBasicXMLRequest(httpMethod, userURL string, ro *RequestOptions) (*http.Request, error) {
tempBuffer := &bytes.Buffer{}

if err := xml.NewEncoder(tempBuffer).Encode(ro.XML); err != nil {
if str, ok := ro.XML.(string); ok {
tempBuffer.WriteString(str)
} else if err := xml.NewEncoder(tempBuffer).Encode(ro.XML); err != nil {
return nil, err
}

Expand Down

0 comments on commit 92b3359

Please sign in to comment.