// SetAllowGetMethodPayload method allows the GET method with payload on `go-resty` client.
// For example: go-resty allows the user sends request with a payload on HTTP GET method.
//		resty.SetAllowGetMethodPayload(true)
//
510154
func (c *Client) SetAllowGetMethodPayload(a bool) *Client {
	c.AllowGetMethodPayload = a
	return c
}
782802
func HTTPGetToFile(client *http.Client, url string, header http.Header, fileName string) error {
	rc, err := HTTPGet(client, url, header)
	if err != nil {
		return err
	}
	defer rc.Close()

	os.MkdirAll(filepath.Dir(fileName), os.ModePerm)
	f, err := os.Create(fileName)
	if err != nil {
		return err
	}
	defer f.Close()
	_, err = io.Copy(f, rc)
	return err
}
1199154
func (s *BatchReadOperation) SetGetObjectAttributes(v *BatchGetObjectAttributes) *BatchReadOperation {
	s.GetObjectAttributes = v
	return s
}
138277
func MemoryRestGetVirtual(context *gin.Context) {
	body, err := memory.ServiceGetVirtualMemory()
	util.RestHandleResponse(context, body, err)
}
17906
func (remote *RemoteDebugger) SetDownloadBehavior(behavior DownloadBehavior, downloadPath string) error {
	params := Params{"behavior": behavior}
	if len(downloadPath) > 0 {
		params["downloadPath"] = downloadPath
	}

	_, err := remote.SendRequest("Page.setDownloadBehavior", params)
	return err
}
409433
func UnmarshalPayload(encoded []byte) (*cb.Payload, error) {
	payload := &cb.Payload{}
	err := proto.Unmarshal(encoded, payload)
	return payload, errors.Wrap(err, "error unmarshaling Payload")
}
1217787
func Get() (p []byte, err error) {
	var l load.LoadAvg
	err = l.Get()
	if err != nil {
		return nil, err
	}
	return json.Marshal(&l)
}
881573
func GetPayloadList(ctx context.Context, requester Requester, r PayloadListRequest) (PayloadList, error) {
	req, err := PrepGetPayloadList(r)
	if err != nil {
		return PayloadList{}, err
	}

	resp, err := requester(ctx, req)
	if err != nil {
		return PayloadList{}, err
	}
	defer resp.Body.Close()

	return NewPayloadList(resp.Body)
}
1311283
func (p *PHYPayload) DecryptFRMPayload(key AES128Key) error {
	if err := p.EncryptFRMPayload(key); err != nil {
		return err
	}

	macPL, ok := p.MACPayload.(*MACPayload)
	if !ok {
		return errors.New("lorawan: MACPayload must be of type *MACPayload")
	}

	// the FRMPayload contains MAC commands, which we need to unmarshal
	var err error
	if macPL.FPort != nil && *macPL.FPort == 0 {
		macPL.FRMPayload, err = decodeDataPayloadToMACCommands(p.isUplink(), macPL.FRMPayload)
	}

	return err
}
420857
func (cli *OpsGenieClient) buildGetRequest(uri string, request interface{}) goreq.Request {
	req := cli.buildCommonRequestProps()
	req.Method = "GET"
	req.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"
	uri = cli.OpsGenieAPIUrl() + uri
	if request != nil {
		v, _ := goquery.Values(request)
		req.Uri = uri + "?" + v.Encode()
	} else {
		req.Uri = uri
	}

	logging.Logger().Info("Executing OpsGenie request to [" + uri + "] with parameters: ")
	return req
}
637442
func getLoad() (loads []float64, err error) {
	data, err := ioutil.ReadFile(procFilePath("loadavg"))
	if err != nil {
		return nil, err
	}
	loads, err = parseLoad(string(data))
	if err != nil {
		return nil, err
	}
	return loads, nil
}
805202
func httpGetRule(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error) {
	log.Debugf("Received httpGetRule: %+v", vars)

	key := vars["key"]

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

	// Return the obj
	return obj, nil
}
356855
func (api *API) RestAPIURL() *gocf.StringExpr {
	return gocf.Join("",
		gocf.String("https://"),
		gocf.Ref(api.LogicalResourceName()),
		gocf.String(".execute-api."),
		gocf.Ref("AWS::Region"),
		gocf.String(".amazonaws.com"))
}
755535
func (q *Query) GetPayload() string {
	j, err := json.Marshal(struct {
		Encoding string `json:"encoding"`
		Method   string `json:"method"`
		NS       string `json:"key"`
	}{
		Encoding: q.encoding,
		Method:   q.method,
		NS:       q.ns,
	})
	sharedutils.CheckError(err)
	return string(j) + "\n"
}
896111
func HTTPGet(httpUrl string) ([]byte, error) {

	r, err := http.Get(httpUrl)

	if err != nil {
		return nil, err
	}

	defer r.Body.Close()

	if err != nil {
		return nil, err
	}

	// read the response and check
	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		return nil, err
	}

	return body, nil
}
696748
func HTTPGet(uri string) ([]byte, error) {
	response, err := http.Get(uri)
	if err != nil {
		return nil, err
	}

	defer response.Body.Close()
	if response.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("http get error : uri=%v , statusCode=%v", uri, response.StatusCode)
	}
	return ioutil.ReadAll(response.Body)
}
468324
func httpGetHeader(h http.Header, key string) string {
	if h == nil {
		return ""
	}
	v := h[key]
	if len(v) == 0 {
		return ""
	}
	return v[0]
}