Skip to content

Class

Request

Represents an HTTP request in an application.
final class Request

Topics

Structures

Initializers

Instance Properties

  • application
  • auth
    Helper for accessing authenticated objects. See Authenticator for more information.
  • body
  • byteBufferAllocator
  • cache
  • client
  • content
    This container is used to read your Decodable type using a ContentDecoder implementation. If no ContentDecoder is provided, a Request’s Content-Type header is used to select a registered decoder.
  • cookies
    Get and set HTTPCookies for this Request This accesses the "Cookie" header.
  • description
    See CustomStringConvertible
  • eventLoop
    The EventLoop which is handling this Request. The route handler and any relevant middleware are invoked in this event loop.
  • fileio
  • hasSession
  • headers
    The header fields for this HTTP request. The "Content-Length" and "Transfer-Encoding" headers will be set automatically when the body property is mutated.
  • id
    A unique ID for the request.
  • logger
    This Logger from Apple’s swift-log Package is preferred when logging in the context of handing this Request. Vapor already provides metadata to this logger so that multiple logged messages can be traced back to the same request.
  • method
    The HTTP method for this request.
  • parameters
    A container containing the route parameters that were captured when receiving this request. Use this container to grab any non-static parameters from the URL, such as model IDs in a REST API.
  • password
  • peerAddress
    We try to determine true peer address if load balancer or reversed proxy provided info in headers
  • peerCertificateChain
    The validated certificate chain. This returns nil if the peer did not authenticate with a certificate. Requires configuring a customCertificateVerifyCallbackWithMetadata that performs the verification.
  • query
  • remoteAddress
    The address from which this HTTP request was received by SwiftNIO. This address may not represent the original address of the peer, especially if Vapor receives its requests through a reverse-proxy such as nginx.
  • route
    Route object we found for this request. This holds metadata that can be used for (for example) Metrics.
  • serviceContext
  • services
  • session
    Returns the current Session or creates one.
  • storage
    This container is used as arbitrary request-local storage during the request-response lifecycle.Z
  • url
    The URL used on this request.
  • version
    The version for this HTTP request.
  • view

Instance Methods

Default Implementations

Relationships

Conforms To