MCPcopy
hub / github.com/ory/kratos / BuildRequest

Method BuildRequest

request/builder.go:227–240  ·  view source on GitHub ↗
(ctx context.Context, body interface{})

Source from the content-addressed store, hash-verified

225}
226
227func (b *Builder) BuildRequest(ctx context.Context, body interface{}) (*retryablehttp.Request, error) {
228 b.r.Header = b.Config.header
229 b.Config.auth.apply(b.r)
230
231 // According to the HTTP spec any request method, but TRACE is allowed to
232 // have a body. Even this is a bad practice for some of them, like for GET
233 if b.Config.Method != http.MethodTrace {
234 if err := b.addBody(ctx, body); err != nil {
235 return nil, err
236 }
237 }
238
239 return b.r, nil
240}
241
242func (b *Builder) addRawBody(body any) (err error) {
243 if isNilInterface(body) {

Callers 4

TestBuildRequestFunction · 0.95
DispatchMethod · 0.95
executeMethod · 0.95
ExecuteMethod · 0.95

Calls 2

addBodyMethod · 0.95
applyMethod · 0.65

Tested by 1

TestBuildRequestFunction · 0.76