SWWebView
SWWebView copied to clipboard
FetchRequest should have body functions (text(), json() etc) too
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 newFetchBody
class, haveFetchResponse
inherit from it - have
FetchRequest
also inherit from it, and read in the request body as an InputStream.