Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

FetchRequest should have body functions (text(), json() etc) too #3

Open
alastaircoote opened this issue Oct 14, 2017 · 0 comments
Open

Comments

@alastaircoote
Copy link
Contributor

In browsers, you can run text(), json() and so on onRequest, the same as you can Response, because they both inherit from Body: https://developer.mozilla.org/en-US/docs/Web/API/Request

We should do the same too, to allow workers to parse content sent in (even factoring in the caveats of #1). Things to do:

  • abstract out these functions from FetchResponse into a new FetchBody class, have FetchResponse inherit from it
  • have FetchRequest also inherit from it, and read in the request body as an InputStream.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant