You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: goupnp.go
    path of file: ./repos/sealer/vendor/github.com/huin/goupnp
    
    the code of the file until where you have to start completion: // goupnp is an implementation of a client for various UPnP services.
//
// For most uses, it is recommended to use the code-generated packag
    
func requestXml(url string, defaultSpace string, doc interface{}) error {
	timeout := time.Duration(3 * time.Second)
	client := http.Client{
		Timeout: timeout,
	}
	resp, err := client.Get(url)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	if resp.StatusCode != 200 {
		return fmt.Errorf("goupnp: got response status %s from %q",
			resp.Status, url)
	}

	decoder := xml.NewDecoder(resp.Body)
	decoder.DefaultSpace = defaultSpace
	decoder.CharsetReader = CharsetReaderDefault

	return decoder.Decode(doc)
}