Documentation

Std.Http.Data.Response

Response #

This module provides the Response type, which represents an HTTP response. It also defines builder functions for constructing responses and selecting common HTTP status codes.

The main parts of a response.

  • status : Status

    The HTTP status for the response.

  • version : Version

    The HTTP protocol version used in the response, e.g. HTTP/1.1.

  • headers : Headers

    The set of response headers, providing metadata such as Content-Type, Content-Length, and caching directives.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      structure Std.Http.Response (t : Type) :

      HTTP response structure parameterized by body type.

      • line : Head

        The response status-line information.

      • body : t

        The content of the response.

      • extensions : Extensions

        Optional dynamic metadata attached to the response.

      Instances For

        Builds an HTTP Response.

        • line : Head

          The response status-line information.

        • extensions : Extensions

          Optional dynamic metadata attached to the response.

        Instances For
          @[implicit_reducible]
          Equations
          • One or more equations did not get rendered due to their size.
          @[implicit_reducible]
          Equations
          • One or more equations did not get rendered due to their size.

          Creates a new HTTP Response builder with default head (status: 200 OK, version: HTTP/1.1).

          Equations
          Instances For

            Creates a new HTTP Response builder with default head (status: 200 OK, version: HTTP/1.1).

            Equations
            Instances For

              Sets the HTTP status code for the response being built.

              Equations
              Instances For

                Sets the headers for the response being built.

                Equations
                Instances For

                  Adds a single header to the response being built.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Adds a single header to the response being built, panics if the header is invalid.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Adds a single header to the response being built. Returns none if the header name or value is invalid.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Std.Http.Response.Builder.extension {α : Type u_1} (builder : Builder) [TypeName α] (data : α) :

                        Inserts a typed extension value into the response being built.

                        Equations
                        Instances For
                          def Std.Http.Response.Builder.body {t : Type} (builder : Builder) (body : t) :

                          Builds and returns the final HTTP Response with the specified body.

                          Equations
                          Instances For

                            Builds and returns the final HTTP Response with an empty body ({}). Requires an EmptyCollection instance for the response body type.

                            Equations
                            Instances For

                              Creates a new HTTP Response builder with the 200 status code.

                              Equations
                              Instances For

                                Creates a new HTTP Response builder with the provided status.

                                Equations
                                Instances For

                                  Creates a new HTTP Response builder with the 404 status code.

                                  Equations
                                  Instances For

                                    Creates a new HTTP Response builder with the 400 status code.

                                    Equations
                                    Instances For

                                      Creates a new HTTP Response builder with the 201 status code.

                                      Equations
                                      Instances For

                                        Creates a new HTTP Response builder with the 202 status code.

                                        Equations
                                        Instances For

                                          Creates a new HTTP Response builder with the 401 status code.

                                          Equations
                                          Instances For

                                            Creates a new HTTP Response builder with the 403 status code.

                                            Equations
                                            Instances For

                                              Creates a new HTTP Response builder with the 409 status code.

                                              Equations
                                              Instances For