santoshbt
Hi All,
I have a requirement to make an API POST call to a graphql endpoint. Here I need to post the body in a JSON format, if I convert it to sctring and encode it, it throws 400 error. It has to be in the below format to get the proper response.
{“query”: “mutation{ setUpUser (setUpUser : {amount: 100 redirectUrl: "https://my.website/home\” reference : "MFNT12312345" customerName : {title: "mr" firstName: "john" lastName: "smith"} customerAddress : {line1: "1" line2: "test" town: "london" postCode: "w1 1aa" county: "london" countryCode: "GB"}}) {transactionRef paymentUrl error transactionStatus}} "}
Please let me know, if there is any way I can make a successful request using elixir. The same syntax works in Postman, but if I execute it via application, HTTPoison or any other libraries accepts it to be an encoded string formats.
TIA.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










First 2 of 2 Posts
benwilson512
Can you concretely show the code you are running that fails?
santoshbt
I think I need to use the libraries like neuron , I am checking how to pass headers which are customized.