NewGetBothRequest generates requests for GetBoth
(server string)
| 317 | |
| 318 | // NewGetBothRequest generates requests for GetBoth |
| 319 | func NewGetBothRequest(server string) (*http.Request, error) { |
| 320 | var err error |
| 321 | |
| 322 | serverURL, err := url.Parse(server) |
| 323 | if err != nil { |
| 324 | return nil, err |
| 325 | } |
| 326 | |
| 327 | operationPath := fmt.Sprintf("/with_both_responses") |
| 328 | if operationPath[0] == '/' { |
| 329 | operationPath = "." + operationPath |
| 330 | } |
| 331 | |
| 332 | queryURL, err := serverURL.Parse(operationPath) |
| 333 | if err != nil { |
| 334 | return nil, err |
| 335 | } |
| 336 | |
| 337 | req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) |
| 338 | if err != nil { |
| 339 | return nil, err |
| 340 | } |
| 341 | |
| 342 | return req, nil |
| 343 | } |
| 344 | |
| 345 | // NewPostJsonRequest calls the generic PostJson builder with application/json body |
| 346 | func NewPostJsonRequest(server string, body PostJsonJSONRequestBody) (*http.Request, error) { |