POST in HTTPoison - trying to upload a file

Hi, i am trting to upload a file using HTTPoison but donot know how can i add arguments that are needed to run the file.

 url = "http://#{target_node}:6666/entrance"
 body = {:file, "executable.sh"}

 HTTPoison.post(url, body)

This uploads the file pretty well but how can i add argument that are required to run the shell script.

i want it to be

curl -X POST http://#{target_node}:6666/entrance --data-binary @hello.escript

Thanks

are required to run the shell script

A POST doesn’t “run” anything unless the server’s configured to do that.

You’ll need to consult the documentation for whatever’s running at http://#{target_node}:6666/entrance to see how it expects arguments, if at all.

1 Like