NewPostOtherRequestWithBody generates requests for PostOther with any type of body
(server string, contentType string, body io.Reader)
| 411 | |
| 412 | // NewPostOtherRequestWithBody generates requests for PostOther with any type of body |
| 413 | func 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 |
| 442 | func NewGetOtherRequest(server string) (*http.Request, error) { |
no test coverage detected
searching dependent graphs…