Skip to content

Creating new request & response objects could be easier #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jakearchibald opened this issue Jun 22, 2018 · 4 comments · Fixed by #1157
Closed

Creating new request & response objects could be easier #771

jakearchibald opened this issue Jun 22, 2018 · 4 comments · Fixed by #1157
Labels
clarification Standard could be clearer

Comments

@jakearchibald
Copy link
Collaborator

In specs, if I want to create a new request, I'm creating the request object, then creating the headers object, then hooking the two up.

With responses it's slightly more complicated, as I need to deal with the trailer promise too.

Is this worth simplifying?

@jakearchibald
Copy link
Collaborator Author

Otherwise, I need to export https://fetch.spec.whatwg.org/#concept-response-trailer-promise.

@annevk
Copy link
Member

annevk commented Jun 23, 2018

I guess you're talking about the platform objects, not the concepts? It's probably good to introduce an abstraction for them, yes.

@jakearchibald jakearchibald changed the title Creating a new request & response could be easier Creating new request & response objects could be easier Jun 23, 2018
@jakearchibald
Copy link
Collaborator Author

Yeah, I mean the platform objects. I'm doing this for background fetch https://wicg.github.io/background-fetch/#create-settled-fetches-algorithm. I'm attempting a more specific description of how requests/responses come out of the cache.

@annevk
Copy link
Member

annevk commented Jun 23, 2018

I guess service workers and the cache API need this too in some way. Should probably take that into account too.

@annevk annevk added the clarification Standard could be clearer label Jan 30, 2021
annevk added a commit that referenced this issue Feb 2, 2021
This also:

* Clarifies some Realms, but more needs to be done in #777 and other issues.
* Ensures that Headers's header list is set correctly for Response.error() and redirect().

Closes #771.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

Successfully merging a pull request may close this issue.

2 participants