Skip to content

Error on requests that return no response body (202) #114

@andrhamm

Description

@andrhamm

APIError: FetchError: invalid json response body [...] reason: Unexpected end of JSON input

Per "Adding an asset" docs:

This returns a 202 empty response from our server

The following request is throwing an error when the library attempts to call .json() on the null response body

await imgix.request(`sources/${sourceId}/assets/add/${originPath}`, {
    method: 'POST',
    body: {},
  })

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions