Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Structure

Request.Body

A view onto this request’s body.
struct Body

Overview

Non-escapable, and bound to the Request it was read from: it can be used for as long as that request value is in scope, but it cannot be stored in a property, returned without a lifetime, or captured by an escaping closure, a Task, or an async let. Capture the Request instead and take .body from it where it is needed.

Topics

Instance Properties

  • var data: Data?
    The buffered body, or nil if there is none or nothing has collected it yet.
  • var description: String
    The buffered body as UTF-8, or empty if nothing has collected it. Not CustomStringConvertible, because that protocol requires an escapable conformer.
  • var string: String?
    The buffered body as UTF-8, or nil if there is none or nothing has collected it yet.

Instance Methods

Relationships

Conforms To

  • Swift.Sendable
  • Swift.SendableMetatype