@libp2p/http
    Preparing search index...

    Extends the native Request class to be more flexible.

    • body - normally GET requests cannot have a body, but if the request is for a WebSocket upgrade, we need the body to turn into the socket

    Also firefox Web Workers remove the request body though weirdly the main thread doesn't.

    • headers - the global browser request removes certain headers like Authorization and Sec-WebSocket-Protocol but we need to preserve them

    Hierarchy

    Index

    Constructors

    Properties

    bodyUsed: boolean
    cache: RequestCache

    The cache read-only property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache.

    MDN Reference

    credentials: RequestCredentials

    The credentials read-only property of the Request interface reflects the value given to the Request() constructor in the credentials option. It determines whether or not the browser sends credentials with the request, as well as whether any Set-Cookie response headers are respected.

    MDN Reference

    destination: RequestDestination

    The destination read-only property of the Request interface returns a string describing the type of content being requested.

    MDN Reference

    headers: Headers

    The headers read-only property of the Request interface contains the Headers object associated with the request.

    MDN Reference

    integrity: string

    The integrity read-only property of the Request interface contains the subresource integrity value of the request.

    MDN Reference

    keepalive: boolean

    The keepalive read-only property of the Request interface contains the request's keepalive setting (true or false), which indicates whether the browser will keep the associated request alive if the page that initiated it is unloaded before the request is complete.

    MDN Reference

    method: string

    The method read-only property of the Request interface contains the request's method (GET, POST, etc.)

    MDN Reference

    mode: RequestMode

    The mode read-only property of the Request interface contains the mode of the request (e.g., cors, no-cors, same-origin, or navigate.) This is used to determine if cross-origin requests lead to valid responses, and which properties of the response are readable.

    MDN Reference

    redirect: RequestRedirect

    The redirect read-only property of the Request interface contains the mode for how redirects are handled.

    MDN Reference

    referrer: string

    The referrer read-only property of the Request interface is set by the user agent to be the referrer of the Request. (e.g., client, no-referrer, or a URL.)

    MDN Reference

    referrerPolicy: ReferrerPolicy

    The referrerPolicy read-only property of the Request interface returns the referrer policy, which governs what referrer information, sent in the Referer header, should be included with the request.

    MDN Reference

    signal: AbortSignal

    The read-only signal property of the Request interface returns the AbortSignal associated with the request.

    MDN Reference

    url: string

    The url read-only property of the Request interface contains the URL of the request.

    MDN Reference

    Methods

    • The clone() method of the Request interface creates a copy of the current Request object.

      MDN Reference

      Returns Request

    • The clone() method of the Request interface creates a copy of the current Request object.

      MDN Reference

      Returns Request

    • Returns Promise<any>

    • Returns Promise<any>

    • Returns Promise<string>

    • Returns Promise<string>