I’m making the following request to Facebook.
Here’s the CURL
curl -X DELETE -F 'payload={
"schema": [
"EMAIL_SHA256"
],
"data": [
[
"SOME_DATA",
]
]
}' -F 'access_token=SOME_TOKEN' https://graph.facebook.com/v6.0/act_SOME_ID/usersofanyaudience
I’m translating this to HTTPoison
url = "https://graph.facebook.com/v6.0/act_SOME_ID/usersofanyaudience"
form_data = {:multipart,
[
{"payload", "{\"schema\": [\"EMAIL_SHA256\"],\"data\": [[\"SOME_DATA\"]]}"},
{"access_token", "SOME_TOKEN"}
]}
HTTPoison.delete(url, form_data)
When I run this I get the following error.
** (ErlangError) Erlang error: {:badrecord, :dict}
(stdlib) dict.erl:413: :dict.get_slot/2
(stdlib) dict.erl:91: :dict.is_key/2
(hackney) deps/hackney/src/hackney_headers_new.erl:94: :hackney_headers_new.store_new/3
(hackney) deps/hackney/src/hackney.erl:569: :hackney.host_header/2
(hackney) deps/hackney/src/hackney.erl:605: :hackney.make_request/6
(hackney) deps/hackney/src/hackney.erl:340: :hackney.request/5
(httpoison) lib/httpoison/base.ex:796: HTTPoison.Base.request/6
Am I translating this CURL to HTTPoison wrong? Is my formatting wrong?