MCPcopy
hub / github.com/supabase/auth / NewPostInviteRequestWithBody

Function NewPostInviteRequestWithBody

client/admin/client.go:1241–1267  ·  view source on GitHub ↗

NewPostInviteRequestWithBody generates requests for PostInvite with any type of body

(server string, contentType string, body io.Reader)

Source from the content-addressed store, hash-verified

1239
1240// NewPostInviteRequestWithBody generates requests for PostInvite with any type of body
1241func 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
1269func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
1270 for _, r := range c.RequestEditors {

Callers 2

PostInviteWithBodyMethod · 0.85
NewPostInviteRequestFunction · 0.85

Calls 2

AddMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…