Skip to content

How to JSON.parse() all responses using REST APIs #228

Discussion options

You must be logged in to vote

Ok I figured it out, this is because of my backend.

The content-type of my data is application/ld+json; charset=utf-8 but the parseBody() function from @apollo/datasource-rest does a response.json() only if:

contentType.startsWith('application/json') || contentType.endsWith('+json')

Some i'm not in this case.

What can I do then ?

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@pepew-le-boss
Comment options

Answer selected by trevor-scheer
@trevor-scheer
Comment options

@trevor-scheer
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants