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

POST and DELETE requests always assume the response is JSON #751

Open
jasonpaulos opened this issue Mar 21, 2023 · 2 comments
Open

POST and DELETE requests always assume the response is JSON #751

jasonpaulos opened this issue Mar 21, 2023 · 2 comments

Comments

@jasonpaulos
Copy link
Member

Problem

Our POST and DELETE request implementations always assume the response is JSON.

More context here: #749 (comment)

Solution

We should improve these handlers to behave like GET, which figures out the response format based on the query parameters for the call, using getAcceptFormat(query).

@Eric-Warehime
Copy link
Contributor

@jasonpaulos Are the simulate responses available in JSON--so that this is just blocking getting them optionally in msgpack? Or are they only returned in msgpack so that the simulate endpoint is broken for this API because is assumes the response is JSON?

@jasonpaulos
Copy link
Member Author

Simulate responses can be returned in either JSON or msgpack, controlled by the format query param. This SDK uses msgpack for the simulation responses.

However this issue isn't a blocker for that workflow, since simulate passes false for the optional parseBody argument to the POST function.

This issue just points out that that's an inconsistency compared to our more popular GET function, which can properly handle both JSON and msgpack responses with parseBody=true.

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

No branches or pull requests

4 participants
@winder @jasonpaulos @Eric-Warehime and others