MCPcopy
hub / github.com/cortexlabs/cortex / HTTPPostObjAsJSON

Function HTTPPostObjAsJSON

cli/cluster/lib_http_client.go:56–62  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, endpoint string, requestData interface{}, qParams ...map[string]string)

Source from the content-addressed store, hash-verified

54}
55
56func HTTPPostObjAsJSON(operatorConfig OperatorConfig, endpoint string, requestData interface{}, qParams ...map[string]string) ([]byte, error) {
57 jsonRequestData, err := json.Marshal(requestData)
58 if err != nil {
59 return nil, err
60 }
61 return HTTPPostJSON(operatorConfig, endpoint, jsonRequestData, qParams...)
62}
63
64func HTTPPostJSON(operatorConfig OperatorConfig, endpoint string, jsonRequestData []byte, qParams ...map[string]string) ([]byte, error) {
65 payload := bytes.NewBuffer(jsonRequestData)

Callers

nothing calls this directly

Calls 2

MarshalFunction · 0.92
HTTPPostJSONFunction · 0.85

Tested by

no test coverage detected