NewPostJsonRequest calls the generic PostJson builder with application/json body
(server string, body PostJsonJSONRequestBody)
| 344 | |
| 345 | // NewPostJsonRequest calls the generic PostJson builder with application/json body |
| 346 | func 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 |
| 357 | func NewPostJsonRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { |
no test coverage detected
searching dependent graphs…