Fetches a file and returns its contents as string.
Parameters
url: string|URL
The file location.
mime: string = 'text/*'
The HTTP Request Accept header. Defaults to 'text/*'.
Returns Promise<string>
The file contents as a string.
Remarks
This is a wrapper around the native fetch API that handles the response status check
and text extraction. It sets the Accept header based on the provided mime type.
Fetches a file and returns its contents as string.