Skip to content

Add Fetch, Headers, Request, and Response APIs #69882

Open

Description

@MayaKirova

Summary

Expose browser networking through a typed asynchronous Fetch projection.

Scope

  • Browser.FetchAsync
  • Browser.Headers
  • Browser.Request
  • Browser.Response
  • Interfaces and supporting types:
    • fetch
    • Headers
    • Request
    • Response
    • Body
    • RequestInit
    • ResponseInit
    • HeadersInit
    • BodyInit
    • Request and response string unions

Activity

  1. added theissue type on Oct 16, 2026
  2. added
    area-blazor
    feature-blazor-jsinterop
    on Oct 16, 2026
  3. added this to the .NET 12 Planning milestone on Oct 19, 2026
  4. self-assigned this
    on Oct 21, 2026
  5. jsakamotoIGJP commented on Oct 21, 2026

    @jsakamotoIGJP
    Contributor

    @skrustev A note on one design point for this family.

    The design for objects that the caller creates, such as new Request(...) and new Headers(...), is not settled yet in this package. Two things are open.

    1. Whether the API should be a factory like Request.CreateAsync(...).

    2. How the caller disposes the created object. One option returns a wrapper type that holds the object in .Value (like UrlSearchParamsOwner). The other returns a derived type that adds IAsyncDisposable (like OwnedUrlSearchParams : UrlSearchParams).
      Both are under discussion in the "URL and URLSearchParams API proposal" ([API Proposal] Add URL and URLSearchParams browser platform APIs #69924). I suggest watching that discussion and following its result. The porting skill does not cover this point yet. It only says these objects are "not designed yet".

  6. jsakamotoIGJP commented on Oct 21, 2026

    @jsakamotoIGJP
    Contributor

    @skrustev Please also take a look at the event listener API proposal (#69922). It is mainly about events, but it also proposes to leave forEach out of the package, and Headers has forEach if I'm not mistaken. Any review or feedback on #69922 itself is welcome, too.

  7. jsakamotoIGJP commented on Oct 21, 2026

    @jsakamotoIGJP
    Contributor

    @skrustev One more note, just for your information. As far as I know, there is no design or guideline yet for how to handle the AbortController behind the signal of fetch() from .NET.

    The porting skill only says to add a CancellationToken where Web IDL has an AbortSignal. It does not say how that token should actually abort the request in the browser.

  8. jsakamotoIGJP commented on Oct 26, 2026

    @jsakamotoIGJP
    Contributor

    @skrustev FYI, I filed a design issue about how a CancellationToken reaches the browser as an AbortSignal (#70044), with a prototype in #70045.

    It affects how FetchAsync can cancel a request, and who owns the AbortController after fetch() returns, which shapes Response. I wanted you to see it early.

    No action is needed from you now. I just did not want it to be a surprise later.

  9. skrustev commented on Oct 26, 2026

    @skrustev
    Contributor

    @jsakamotoIGJP I already had been working on how it would looks like in the context of the Fetch request. I'll refer to your document then and it can be compared to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-blazorfeature-blazor-jsinterop

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions