Documentation

Std.Internal.Http.Data.Body.Full

Body.Full #

A body backed by a fixed ByteArray held in a Mutex.

The byte array is consumed at most once: the first call to recv atomically takes the data and returns it as a single chunk; subsequent calls return none (end-of-stream). Closing the body discards any unconsumed data.

A body backed by a fixed, mutex-protected ByteArray.

The data is consumed on the first read. Once consumed (or explicitly closed), the body behaves as a closed, empty channel.

Instances For

    Creates a Full body from a String.

    Instances For

      Receives the body data. Returns the full byte array on the first call as a single chunk, then none on all subsequent calls.

      Instances For

        Closes the body, discarding any unconsumed data.

        Instances For

          Returns true when the data has been consumed or the body has been closed.

          Instances For

            Returns the known size of the remaining data. Returns some (.fixed n) with the current byte count, or some (.fixed 0) if the body has already been consumed or closed.

            Instances For

              Selector that immediately resolves to the remaining chunk (or EOF).

              Instances For
                @[implicit_reducible]
                @[implicit_reducible]

                Builds a request body from raw bytes without setting any headers. Use bytes instead if you want Content-Type: application/octet-stream set automatically.

                Instances For

                  Builds a request with a binary body. Sets Content-Type: application/octet-stream. Use fromBytes instead if you need to set a different Content-Type or none at all.

                  Instances For

                    Builds a request with a text body. Sets Content-Type: text/plain; charset=utf-8.

                    Instances For

                      Builds a request with a JSON body. Sets Content-Type: application/json.

                      Instances For

                        Builds a request with an HTML body. Sets Content-Type: text/html; charset=utf-8.

                        Instances For

                          Builds a response body from raw bytes without setting any headers. Use bytes instead if you want Content-Type: application/octet-stream set automatically.

                          Instances For

                            Builds a response with a binary body. Sets Content-Type: application/octet-stream. Use fromBytes instead if you need to set a different Content-Type or none at all.

                            Instances For

                              Builds a response with a text body. Sets Content-Type: text/plain; charset=utf-8.

                              Instances For

                                Builds a response with a JSON body. Sets Content-Type: application/json.

                                Instances For

                                  Builds a response with an HTML body. Sets Content-Type: text/html; charset=utf-8.

                                  Instances For