MCPcopy Create free account
hub / github.com/imroc/req / SetBodyJsonString

Method SetBodyJsonString

request.go:916–918  ·  view source on GitHub ↗

SetBodyJsonString set the request Body as string and set Content-Type header as "application/json; charset=utf-8"

(body string)

Source from the content-addressed store, hash-verified

914// SetBodyJsonString set the request Body as string and set Content-Type header
915// as "application/json; charset=utf-8"
916func (r *Request) SetBodyJsonString(body string) *Request {
917 return r.SetBodyJsonBytes([]byte(body))
918}
919
920// SetBodyJsonBytes set the request Body as []byte and set Content-Type header
921// as "application/json; charset=utf-8"

Callers 3

SetBodyJsonStringFunction · 0.80
TestSetBodyFunction · 0.80

Calls 1

SetBodyJsonBytesMethod · 0.95

Tested by 2

TestSetBodyFunction · 0.64