NewPostInviteRequestWithBody generates requests for PostInvite with any type of body
(server string, contentType string, body io.Reader)
| 1239 | |
| 1240 | // NewPostInviteRequestWithBody generates requests for PostInvite with any type of body |
| 1241 | func NewPostInviteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { |
| 1242 | var err error |
| 1243 | |
| 1244 | serverURL, err := url.Parse(server) |
| 1245 | if err != nil { |
| 1246 | return nil, err |
| 1247 | } |
| 1248 | |
| 1249 | operationPath := fmt.Sprintf("/invite") |
| 1250 | if operationPath[0] == '/' { |
| 1251 | operationPath = "." + operationPath |
| 1252 | } |
| 1253 | |
| 1254 | queryURL, err := serverURL.Parse(operationPath) |
| 1255 | if err != nil { |
| 1256 | return nil, err |
| 1257 | } |
| 1258 | |
| 1259 | req, err := http.NewRequest("POST", queryURL.String(), body) |
| 1260 | if err != nil { |
| 1261 | return nil, err |
| 1262 | } |
| 1263 | |
| 1264 | req.Header.Add("Content-Type", contentType) |
| 1265 | |
| 1266 | return req, nil |
| 1267 | } |
| 1268 | |
| 1269 | func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { |
| 1270 | for _, r := range c.RequestEditors { |
no test coverage detected
searching dependent graphs…