MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / NewPostJsonRequest

Function NewPostJsonRequest

internal/test/client/client.gen.go:346–354  ·  view source on GitHub ↗

NewPostJsonRequest calls the generic PostJson builder with application/json body

(server string, body PostJsonJSONRequestBody)

Source from the content-addressed store, hash-verified

344
345// NewPostJsonRequest calls the generic PostJson builder with application/json body
346func NewPostJsonRequest(server string, body PostJsonJSONRequestBody) (*http.Request, error) {
347 var bodyReader io.Reader
348 buf, err := json.Marshal(body)
349 if err != nil {
350 return nil, err
351 }
352 bodyReader = bytes.NewReader(buf)
353 return NewPostJsonRequestWithBody(server, "application/json", bodyReader)
354}
355
356// NewPostJsonRequestWithBody generates requests for PostJson with any type of body
357func NewPostJsonRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {

Callers 1

PostJsonMethod · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…