NewCreateTaskRequestWithBody generates requests for CreateTask with any type of body
(server string, contentType string, body io.Reader)
| 329 | |
| 330 | // NewCreateTaskRequestWithBody generates requests for CreateTask with any type of body |
| 331 | func NewCreateTaskRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { |
| 332 | var err error |
| 333 | |
| 334 | serverURL, err := url.Parse(server) |
| 335 | if err != nil { |
| 336 | return nil, err |
| 337 | } |
| 338 | |
| 339 | operationPath := fmt.Sprintf("/tasks") |
| 340 | if operationPath[0] == '/' { |
| 341 | operationPath = "." + operationPath |
| 342 | } |
| 343 | |
| 344 | queryURL, err := serverURL.Parse(operationPath) |
| 345 | if err != nil { |
| 346 | return nil, err |
| 347 | } |
| 348 | |
| 349 | req, err := http.NewRequest("POST", queryURL.String(), body) |
| 350 | if err != nil { |
| 351 | return nil, err |
| 352 | } |
| 353 | |
| 354 | req.Header.Add("Content-Type", contentType) |
| 355 | |
| 356 | return req, nil |
| 357 | } |
| 358 | |
| 359 | // NewSearchTaskRequest calls the generic SearchTask builder with application/json body |
| 360 | func NewSearchTaskRequest(server string, body SearchTaskJSONRequestBody) (*http.Request, error) { |
no outgoing calls
no test coverage detected