Httpoison POST, is this the correct way?

I am translating this curl POST request to HTTPoison. Is this the correct way

CURL:
curl -X POST “http://example.com/index?args=20” --data-binary @hello.sh

HTTPoison:

url = "http://example.com/index?args=20"
body = {:file, "hello.sh"}

HTTPoison.post(url, body)

What does it do when you run it?

Also, consider consolidating this with your question from yesterday: How to write curl query in elixir

2 Likes