Skip to content

Allow responses other that json (or plain text) #10

Open
@doktordirk

Description

@doktordirk

Atm, other formats are not allowed. To be backwards compatible, one option could be to always also return the original response

async function getResponseData(response: Response) {
// ...
const text = await response.clone().text()
//...
}
async function fetchJson(url: string, init: RequestInit): Promise<ApiResponse> {
//...
 const result = {
	...response,
    data,
  }
//...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions