MCPcopy
hub / github.com/gofiber/fiber / XML

Method XML

bind.go:331–342  ·  view source on GitHub ↗

XML binds the body string into the struct. Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

(out any)

Source from the content-addressed store, hash-verified

329// XML binds the body string into the struct.
330// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).
331func (b *Bind) XML(out any) error {
332 bind := binder.GetFromThePool[*binder.XMLBinding](&binder.XMLBinderPool)
333 bind.XMLDecoder = b.ctx.App().config.XMLDecoder
334
335 defer releasePooledBinder(&binder.XMLBinderPool, bind)
336
337 if err := b.returnBindErr(bind.Bind(b.ctx.Body(), out), BindSourceBody); err != nil {
338 return err
339 }
340
341 return b.validateStruct(out)
342}
343
344// Form binds the form into the struct, map[string]string and map[string][]string.
345// Returns *BindError on parse failure (manual mode) or *Error with status 400 (auto-handling mode).

Callers 1

BodyMethod · 0.95

Calls 6

returnBindErrMethod · 0.95
validateStructMethod · 0.95
releasePooledBinderFunction · 0.85
AppMethod · 0.65
BindMethod · 0.65
BodyMethod · 0.65

Tested by

no test coverage detected