Documentation

Std.Internal.Http.Data.Request

Request #

This module provides the Request type, which represents an HTTP request. It also defines ways to build a Request using functions that make it easier.

References:

The main parts of a request containing the HTTP method, version, and request target URI.

Reference: https://httpwg.org/specs/rfc9112.html#request.line

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

      HTTP request structure parameterized by body type.

      • line : Head

        The request line information (method, version, and request-target uri).

      • body : t

        The request body content of type t.

      • extensions : Extensions

        Optional dynamic metadata attached to the request.

      Instances For
        Equations
        Instances For

          Builds an HTTP Request.

          • line : Head

            The request-line of an HTTP request.

          • extensions : Extensions

            Optional dynamic metadata attached to the request.

          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 request builder with the default head (method: GET, version: HTTP/1.1, target: *).

            Equations
            Instances For

              Sets the HTTP method for the request being built.

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

                Sets the HTTP version for the request being built.

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

                  Sets the request target/URI for the request being built.

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

                    Sets the request target/URI for the request being built

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

                      Sets the headers for the request being built

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

                        Adds a single header to the request being built.

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

                          Adds a single header to the request 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 request 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

                              Adds a header to the request being built only if the Option Header.Value is some.

                              Equations
                              Instances For
                                def Std.Http.Request.Builder.extension {α : Type u_1} (builder : Builder) [TypeName α] (data : α) :

                                Inserts a typed extension value into the request being built.

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

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

                                  Equations
                                  Instances For

                                    Creates a new HTTP GET Request with the specified URI.

                                    Equations
                                    Instances For

                                      Creates a new HTTP POST Request builder with the specified URI.

                                      Equations
                                      Instances For

                                        Creates a new HTTP PUT Request builder with the specified URI.

                                        Equations
                                        Instances For

                                          Creates a new HTTP DELETE Request builder with the specified URI.

                                          Equations
                                          Instances For

                                            Creates a new HTTP PATCH Request builder with the specified URI.

                                            Equations
                                            Instances For

                                              Creates a new HTTP HEAD Request builder with the specified URI.

                                              Equations
                                              Instances For

                                                Creates a new HTTP OPTIONS Request builder with the specified URI. Use Request.options (RequestTarget.asteriskForm) for server-wide OPTIONS.

                                                Equations
                                                Instances For

                                                  Creates a new HTTP CONNECT Request builder with the specified URI. Typically used with RequestTarget.authorityForm for tunneling.

                                                  Equations
                                                  Instances For

                                                    Creates a new HTTP TRACE Request builder with the specified URI.

                                                    Equations
                                                    Instances For