Add tests

This commit is contained in:
Ming Deng
2021-01-03 16:02:03 +08:00
parent 44ffb29c55
commit b89dc5068a
3 changed files with 117 additions and 0 deletions

View File

@@ -319,6 +319,9 @@ func (b *BeegoHTTPRequest) XMLBody(obj interface{}) (*BeegoHTTPRequest, error) {
return b, err
}
b.req.Body = ioutil.NopCloser(bytes.NewReader(byts))
b.req.GetBody = func() (io.ReadCloser, error) {
return ioutil.NopCloser(bytes.NewReader(byts)), nil
}
b.req.ContentLength = int64(len(byts))
b.req.Header.Set("Content-Type", "application/xml")
}