SWWebView icon indicating copy to clipboard operation
SWWebView copied to clipboard

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

Open alastaircoote opened this issue 7 years ago • 0 comments

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.

alastaircoote avatar Oct 14 '17 17:10 alastaircoote