mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 17:50:58 +00:00
Remove some unnecessary code
This commit is contained in:
parent
1f1190fbc3
commit
d27c5c8daf
@ -395,11 +395,8 @@ func (b *BeegoHttpRequest) ToFile(filename string) error {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
_, err = io.Copy(f, resp.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ToJson returns the map that marshals from the body bytes as json in response .
|
||||
// it calls Response inner.
|
||||
@ -409,11 +406,8 @@ func (b *BeegoHttpRequest) ToJson(v interface{}) error {
|
||||
return err
|
||||
}
|
||||
err = json.Unmarshal(data, v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ToXml returns the map that marshals from the body bytes as xml in response .
|
||||
// it calls Response inner.
|
||||
@ -423,11 +417,8 @@ func (b *BeegoHttpRequest) ToXML(v interface{}) error {
|
||||
return err
|
||||
}
|
||||
err = xml.Unmarshal(data, v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Response executes request client gets response mannually.
|
||||
func (b *BeegoHttpRequest) Response() (*http.Response, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user