MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / Post

Function Post

pkg/httpcli/httpcli.go:384–388  ·  view source on GitHub ↗

Post request, return custom json format

(result interface{}, urlStr string, body interface{}, opts ...Option)

Source from the content-addressed store, hash-verified

382
383// Post request, return custom json format
384func Post(result interface{}, urlStr string, body interface{}, opts ...Option) error {
385 o := defaultOptions()
386 o.apply(opts...)
387 return do("POST", result, urlStr, body, o.params, o.headers, o.timeout)
388}
389
390// Put request, return custom json format
391func Put(result interface{}, urlStr string, body interface{}, opts ...Option) error {

Callers 7

TestRequestFunction · 0.92
TestPushEventHandlerFunction · 0.92
TestPostFunction · 0.85

Calls 3

defaultOptionsFunction · 0.70
doFunction · 0.70
applyMethod · 0.65

Tested by 7

TestRequestFunction · 0.74
TestPushEventHandlerFunction · 0.74
TestPostFunction · 0.68