MCPcopy Create free account
hub / github.com/kataras/iris / JSON

Method JSON

x/client/client.go:312–315  ·  view source on GitHub ↗

JSON writes data as JSON to the server.

(ctx context.Context, method, urlpath string, payload interface{}, opts ...RequestOption)

Source from the content-addressed store, hash-verified

310
311// JSON writes data as JSON to the server.
312func (c *Client) JSON(ctx context.Context, method, urlpath string, payload interface{}, opts ...RequestOption) (*http.Response, error) {
313 opts = append(opts, RequestHeader(true, contentTypeKey, contentTypeJSON))
314 return c.Do(ctx, method, urlpath, payload, opts...)
315}
316
317// JSON writes form data to the server.
318func (c *Client) Form(ctx context.Context, method, urlpath string, formValues url.Values, opts ...RequestOption) (*http.Response, error) {

Callers 15

testSessionsFunction · 0.45
TestFlashMessagesFunction · 0.45
mainFunction · 0.45
FailJSONFunction · 0.45
GetAllMethod · 0.45
GetMethod · 0.45
AddMethod · 0.45
CreateMethod · 0.45
GetByIDMethod · 0.45
ListMethod · 0.45
CreateMethod · 0.45

Calls 2

DoMethod · 0.95
RequestHeaderFunction · 0.85

Tested by 15

testSessionsFunction · 0.36
TestFlashMessagesFunction · 0.36
TestGRPCCompatibleFunction · 0.36
TestMVCHelloWorldFunction · 0.36
TestAppFunction · 0.36
TestContentNegotiationFunction · 0.36
TestReadBodyAndNegotiateFunction · 0.36
TestRoutingBasicFunction · 0.36