Enumeration: FetchResultTypes
The supported return types for the fetch
method
Enumeration Members
Enumeration Member | Value | Description | Defined in |
---|---|---|---|
Blob | "blob" | Returns only the body, as a Blob . Remark For NodeJS environment other FetchResultTypes are recommended, but you can use a Blob if you want to. | projects/utilities/packages/fetch/src/lib/types.ts:25 |
Buffer | "buffer" | Returns only the body, as a Buffer. Remark Does not work in a Browser environment. For browsers use FetchResultTypes.Blob instead. If you use this type in a Browsers environment a ReferenceError: Buffer is not defined will be thrown! | projects/utilities/packages/fetch/src/lib/types.ts:20 |
JSON | "json" | Returns only the body, as JSON. Similar to Body.json() . You should provide your own type cast (either through the generic return type, or with as <type> ) to the response to define the JSON structure, otherwise the result will be unknown . | projects/utilities/packages/fetch/src/lib/types.ts:14 |
Result | "result" | Returns the entire response and doesn't parse the body in any way. | projects/utilities/packages/fetch/src/lib/types.ts:33 |
Text | "text" | Returns only the body, as plain text. Similar to Body.text() . | projects/utilities/packages/fetch/src/lib/types.ts:29 |