fetch
function available with window
object. It adds very thin layer of code, but it will be more accurate with type system and usage of unknown
instead of any
.status
, statusText
and headers
. To get to the response body, you must pick a fetch with a body parser. This is what withJSON
and alike properties are.json
property to the response object. It will be of type depending on status and status-to-response object provided as a generic argument to fetch function.text
property to the response object.ArrayBuffer
in arrayBuffer
property in the response object.Blob
in blob
property in the response object.FormData
in formData
property in the response object.fetchWithJSON
etc.fetch
uses single argument and returns an Observable
, it can be used as an operator.