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

Sopport JSON body for POST?! #23

Open
strdr4605 opened this issue Sep 11, 2019 · 2 comments
Open

Sopport JSON body for POST?! #23

strdr4605 opened this issue Sep 11, 2019 · 2 comments

Comments

@strdr4605
Copy link

I use https://github.com/ryb73/ppx_decco to encode and decode the records and JSONs

To work with Axios I need to do

Axios.postData(url, mytype_encode(response) |> Obj.magic) |> then_(...)

did not try with GET but will be useful to have body and response as JSON?!
What do you think?!

@meafmira
Copy link
Owner

meafmira commented Sep 16, 2019

@strdr4605 I'm not sure which types produces your ppx. What do you suggest?

@strdr4605
Copy link
Author

@meafmira,
response is a record
mytype_encode(response) returns Js.Json.t.
Maybe bs-axios can do Obj.magic under the hood. and take Js.Json.t as a POST body and also return Js.Json.t?!

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

2 participants