Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser error on non-json body #7

Open
w-a-b opened this issue Jul 16, 2020 · 0 comments
Open

Parser error on non-json body #7

w-a-b opened this issue Jul 16, 2020 · 0 comments

Comments

@w-a-b
Copy link

w-a-b commented Jul 16, 2020

This library seems to be abandoned, but I post this in case others stumble upon the same problem (ended up using raw fetch instead of apicase for this):

If I invoke an endpoint that returns an Image / ReadableStream, I will get a JSON.stringify error unless I specify a parser other than "json" in the payload. The param should be a String, according to the docs:

// Response parser // default: 'json' "parser": String,

However, the code seems to expect an object like

{done: 'someParser', fail: 'json'}

And even with the parser-option defined like this, it will then fail on line 95 of index.js:
return res[parser]()

Why does the line above expect a parser function on the raw res(ult)-object from fetch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant