MCPcopy Index your code
hub / github.com/cortexlabs/cortex / HTTPPostJSON

Function HTTPPostJSON

cli/cluster/lib_http_client.go:64–72  ·  view source on GitHub ↗
(operatorConfig OperatorConfig, endpoint string, jsonRequestData []byte, qParams ...map[string]string)

Source from the content-addressed store, hash-verified

62}
63
64func HTTPPostJSON(operatorConfig OperatorConfig, endpoint string, jsonRequestData []byte, qParams ...map[string]string) ([]byte, error) {
65 payload := bytes.NewBuffer(jsonRequestData)
66 req, err := operatorRequest(operatorConfig, http.MethodPost, endpoint, payload, qParams...)
67 if err != nil {
68 return nil, err
69 }
70 req.Header.Set("Content-Type", "application/json")
71 return makeOperatorRequest(operatorConfig, req)
72}
73
74func HTTPPostNoBody(operatorConfig OperatorConfig, endpoint string, qParams ...map[string]string) ([]byte, error) {
75 req, err := operatorRequest(operatorConfig, http.MethodPost, endpoint, nil, qParams...)

Callers 1

HTTPPostObjAsJSONFunction · 0.85

Calls 3

operatorRequestFunction · 0.85
makeOperatorRequestFunction · 0.85
SetMethod · 0.80

Tested by

no test coverage detected