In this article we will learn about some of the frequently asked about Elixir programming questions in technical like “HTTPoison post json” Code Answer. When creating scripts and web applications, error handling is an important part. If your code lacks error checking code, your program may look very unprofessional and you may be open to security risks. Error or stack handling on Elixir was simple and easy. An error message with filename, line number and a message describing the error is sent to the browser. This tutorial contains some of the most common error checking methods in Elixir. Below are some solution about “HTTPoison post json” Code Answer.
HTTPoison post json
xxxxxxxxxx
1
url = "http://myurl"
2
body = Poison.encode!(%{
3
"call": "MyCall",
4
"app_key": key,
5
"param": [
6
%{
7
"page": page,
8
"registres": registers,
9
"filter": filter
10
}
11
]
12
})
13
headers = [{"Content-type", "application/json"}]
14
HTTPoison.post(url, body, headers, [])
15