// GetRequestBody ...
18831
func GetRequestBody(m *SGMailV3) []byte {
	b, err := json.Marshal(m)
	if err != nil {
		log.Println(err)
	}
	return b
}
805678
func (b *HttpRequest) JsonBody(obj interface{}) (*HttpRequest, error) {
	if b.req.Body == nil && obj != nil {
		buf := bytes.NewBuffer(nil)
		enc := json.NewEncoder(buf)
		if err := enc.Encode(obj); err != nil {
			return b, err
		}
		b.req.Body = ioutil.NopCloser(buf)
		b.req.ContentLength = int64(buf.Len())
		b.req.Header.Set("Content-Type", "application/json")
	}
	return b, nil
}
771724
func (c *Network) GetResponseBody(requestId string) (string, bool, error) {
	var v NetworkGetResponseBodyParams
	v.RequestId = requestId
	return c.GetResponseBodyWithParams(&v)
}
660500
func (r *Request) Body(v interface{}) *Request {
	var err error
	if r.err != nil {
		return r
	}
	r.body, err = json.Marshal(v)
	if err != nil {
		r.err = err
		return r
	}
	return r
}
49425
func (c BasicCredential) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
	return map[string]string{
		c.username: c.password,
	}, nil
}
250312
func (s *UpdateByQueryService) Body(body string) *UpdateByQueryService {
	s.body = body
	return s
}
1175647
func (c *Client) GetBodyOfHTTPResponse(u *url.URL) ([]byte, error) {
	resp, err := c.GetHTTPResponse(u)
	if err != nil {
		return []byte{}, err
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	return body, err
}
1337397
func (remote *RemoteDebugger) GetResponseBody(req string) ([]byte, error) {
	res, err := remote.SendRequest("Network.getResponseBody", Params{
		"requestId": req,
	})

	if err != nil {
		return nil, err
	}

	body := res["body"]
	if body == nil {
		return nil, nil
	}

	if b, ok := res["base64Encoded"]; ok && b.(bool) {
		return base64.StdEncoding.DecodeString(body.(string))
	} else {
		return []byte(body.(string)), nil
	}
}
459255
func (tib *TypeInBody) Body() raml.Bodies {
	if tib.ReqResp == HTTPRequest {
		return tib.Endpoint.Method.Bodies
	}
	for code, resp := range tib.Endpoint.Method.Responses {
		if code == tib.RespCode {
			return resp.Bodies
		}
	}
	panic("failed to get body of " + tib.Endpoint.Verb + " " + tib.Endpoint.Addr)
}
344960
func (req *Request) GetRequestURI() string {
	uri, _ := req.GetValue(HTTP_REQUEST_URI).(string)
	return uri
}
1183066
func JsonBody(body interface{}) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		b, err := simplejson.DumpBytes(body)
		if err != nil {
			return nil, err
		}
		req.Body = ioutil.NopCloser(bytes.NewBuffer(b))
		req.ContentLength = int64(len(b))
		req.Header.Set("Content-Type", "application/json; charset=utf-8")
		return req, nil
	}
}
390408
func parseBody(resp *http.Response, o interface{}) error {
	err := json.NewDecoder(resp.Body).Decode(&o)
	if err != nil {
		resp.Body.Close()
		return err
	} else {
		return resp.Body.Close()
	}
}
1099147
func (r *Resource) Request(method string, body ...interface{}) *http.Request {
	rdr := io.MultiReader() // empty body by default
	if len(body) != 0 {
		rdr = encode(body[0])
	}
	req, err := http.NewRequest(method, r.u.String(), rdr)
	if err != nil {
		panic(err)
	}
	return req
}
1086788
func (p *Project) GetBody() string {
	if p == nil || p.Body == nil {
		return ""
	}
	return *p.Body
}
520613
func getBody(id string, actionType models.ActionType) ([]byte, error) {
	return json.Marshal(models.CallbackAlert{ActionType: actionType, Id: id})
}
722561
func (r *RequestConfig) Body(body string) *RequestConfig {
	r.BodyReader = strings.NewReader(body)
	return r
}
368312
func (p *PullRequestComment) GetBody() string {
	if p == nil || p.Body == nil {
		return ""
	}
	return *p.Body
}