dex/vendor/github.com/mbanzon/simplehttp/parsing.go

16 lines
315 B
Go
Raw Normal View History

2015-08-18 05:57:27 +05:30
package simplehttp
import (
"encoding/json"
"encoding/xml"
)
// Parses the HTTPResponse as JSON to the given interface.
func (r *HTTPResponse) ParseFromJSON(v interface{}) error {
return json.Unmarshal(r.Data, v)
}
func (r *HTTPResponse) ParseFromXML(v interface{}) error {
return xml.Unmarshal(r.Data, v)
}