// HTTPGetBytes gets the specified resource. ErrNotFound is returned if the server
// responds with status 404.
420441
func HTTPGetBytes(client *http.Client, url string, header http.Header) ([]byte, error) {
	rc, err := HTTPGet(client, url, header)
	if err != nil {
		return nil, err
	}
	defer rc.Close()
	return ioutil.ReadAll(rc)
}
652507
func getBytes(json []byte, path string) Result {
	var result Result
	if json != nil {
		// unsafe cast to string
		result = Get(*(*string)(unsafe.Pointer(&json)), path)
		// safely get the string headers
		rawhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Raw))
		strhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Str))
		// create byte slice headers
		rawh := reflect.SliceHeader{Data: rawhi.Data, Len: rawhi.Len}
		strh := reflect.SliceHeader{Data: strhi.Data, Len: strhi.Len}
		if strh.Data == 0 {
			// str is nil
			if rawh.Data == 0 {
				// raw is nil
				result.Raw = ""
			} else {
				// raw has data, safely copy the slice header to a string
				result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh)))
			}
			result.Str = ""
		} else if rawh.Data == 0 {
			// raw is nil
			result.Raw = ""
			// str has data, safely copy the slice header to a string
			result.Str = string(*(*[]byte)(unsafe.Pointer(&strh)))
		} else if strh.Data >= rawh.Data &&
			int(strh.Data)+strh.Len <= int(rawh.Data)+rawh.Len {
			// Str is a substring of Raw.
			start := int(strh.Data - rawh.Data)
			// safely copy the raw slice header
			result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh)))
			// substring the raw
			result.Str = result.Raw[start : start+strh.Len]
		} else {
			// safely copy both the raw and str slice headers to strings
			result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh)))
			result.Str = string(*(*[]byte)(unsafe.Pointer(&strh)))
		}
	}
	return result
}
886699
func (h HTTPGetProbe) String() string {
	return fmt.Sprintf(`Path="%s" Port=%d HTTPHeaders=%s`,
		h.Path,
		h.Port,
		h.HTTPHeaders)
}
1054833
func (d Data) GetBytes(key string) []byte {
	return []byte(d.Get(key))
}
1253362
func httpGetServiceLB(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpGetServiceLB: %+v", vars)

	key := vars["key"]

	collections.serviceLBMutex.Lock()
	defer collections.serviceLBMutex.Unlock()
	obj := collections.serviceLBs[key]
	if obj == nil {
		log.Infof("serviceLB %s not found", key)
		return nil, errors.New("serviceLB not found")
	}

	// Return the obj
	return obj, nil
}
1178446
func httpGetNetwork(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpGetNetwork: %+v", vars)

	key := vars["key"]

	collections.networkMutex.Lock()
	defer collections.networkMutex.Unlock()
	obj := collections.networks[key]
	if obj == nil {
		log.Infof("network %s not found", key)
		return nil, errors.New("network not found")
	}

	// Return the obj
	return obj, nil
}
1123052
func get(url string) ([]byte, string) {
	resp, err := http.Get(url)
	if err != nil {
		log.Fatal("Error getting url.")
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	ct := resp.Header.Get("Content-Type")

	if resp.StatusCode == 200 && len(body) > 512 {
		return body, ct
	}

	if DefaultImage() == "" {
		return []byte(""), ct
	}

	if url == DefaultImage() {
		panic("Catching an infinite loop! Default Image doesn't exist or is broken. Please rectify!")
	}

	return get(DefaultImage())
}
236370
func (bow *Browser) httpGET(u *url.URL, ref *url.URL) error {
	req, err := bow.buildRequest("GET", u.String(), ref, nil)
	if err != nil {
		return err
	}
	return bow.httpRequest(req)
}
251720
func (c *syncClient) Hgetall(arg0 string) (result [][]byte, err Error) {
	arg0bytes := []byte(arg0)

	var resp Response
	resp, err = c.conn.ServiceRequest(&HGETALL, [][]byte{arg0bytes})
	if err == nil {
		result = resp.GetMultiBulkData()
	}
	return result, err

}
965911
func (n *node) GetBytes(bucketName string, key interface{}) ([]byte, error) {
	id, err := toBytes(key, n.codec)
	if err != nil {
		return nil, err
	}

	var val []byte
	return val, n.readTx(func(tx *bolt.Tx) error {
		raw, err := n.getBytes(tx, bucketName, id)
		if err != nil {
			return err
		}

		val = make([]byte, len(raw))
		copy(val, raw)
		return nil
	})
}
1107591
func httpGetBgp(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpGetBgp: %+v", vars)

	key := vars["key"]

	collections.BgpMutex.Lock()
	defer collections.BgpMutex.Unlock()
	obj := collections.Bgps[key]
	if obj == nil {
		log.Infof("Bgp %s not found", key)
		return nil, errors.New("Bgp not found")
	}

	// Return the obj
	return obj, nil
}
1061950
func (c *RawBinaryClient) Get(key string) GetResponse {
	c.mutex.Lock()
	defer c.mutex.Unlock()

	if resp := c.sendGetRequest(key); resp != nil {
		return resp
	}

	return c.receiveGetResponse(key)
}
216656
func Get(url string) (resp *http.Response, err error) {
	c := New()
	return c.Get(url)
}
1320189
func (c *Cache) GetBytes(id string) (ItemInfo, []byte, error) {
	id = cleanID(id)

	c.nlocker.Lock(id)
	defer c.nlocker.Unlock(id)

	info := ItemInfo{Name: id}

	if r := c.getOrRemove(id); r != nil {
		defer r.Close()
		b, err := ioutil.ReadAll(r)
		return info, b, err
	}

	return info, nil, nil
}
195575
func Get(urlStr string, params map[string]interface{}) (*HttpResponse, error) {
	resp, err := DefaultClient.Get(URLWithParams(urlStr, params).String())
	if err == nil {
		return &HttpResponse{*resp}, nil
	} else {
		CloseResponse(resp)
		return nil, err
	}
}
395605
func (c *Client) Get(url string, header map[string]string) ([]byte, error) {
	req, err := c.newRequest("GET", url, header)
	if err != nil {
		return nil, err
	}

	resp, err := c.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	bytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, err
	}

	return bytes, nil
}
645424
func (c *Ctx) JSONBytes(code int, b []byte) (err error) {

	c.response.Header().Set(ContentType, ApplicationJSONCharsetUTF8)
	c.response.WriteHeader(code)
	_, err = c.response.Write(b)
	return
}