Skip Navigation
StructureStructure

HTTPResponse

An HTTP response structure for static file serving.

struct HTTPResponse

Overview

This type encapsulates an HTTP response head (status code and headers) along with an optional response body. All instances are Sendable, making them safe to pass across concurrency boundaries.

Overview

HTTPResponse provides factory methods for common HTTP status codes, making it easy to construct appropriate responses for various scenarios encountered during static file serving.

Relationships

  • Swift.Sendable
  • Swift.SendableMetatype