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

Function NewPostOtherRequestWithBody

internal/test/client/client.gen.go:413–439  ·  view source on GitHub ↗

NewPostOtherRequestWithBody generates requests for PostOther with any type of body

(server string, contentType string, body io.Reader)

Source from the content-addressed store, hash-verified

411
412// NewPostOtherRequestWithBody generates requests for PostOther with any type of body
413func NewPostOtherRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
414 var err error
415
416 serverURL, err := url.Parse(server)
417 if err != nil {
418 return nil, err
419 }
420
421 operationPath := fmt.Sprintf("/with_other_body")
422 if operationPath[0] == '/' {
423 operationPath = "." + operationPath
424 }
425
426 queryURL, err := serverURL.Parse(operationPath)
427 if err != nil {
428 return nil, err
429 }
430
431 req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
432 if err != nil {
433 return nil, err
434 }
435
436 req.Header.Add("Content-Type", contentType)
437
438 return req, nil
439}
440
441// NewGetOtherRequest generates requests for GetOther
442func NewGetOtherRequest(server string) (*http.Request, error) {

Callers 1

PostOtherWithBodyMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…