6
HTTPiisonライブラリを使用してElixirにGithubトークンを作成したいが、私はパラメータをHTTPoisonに送信する方法を見つけられない。 curl
を使用している場合Elixir HTTPoisonライブラリを使用してGithub Tokenを作成する
、それは私がHTTPoisonライブラリを使用する場合、私はちょうどそれを投稿する方法を見つけ出すことはできませんthis
$ curl -i -u "ColdFreak" -H "X-GitHub-OTP: 123456" -d '{"scopes": ["repo", "user"], "note"
: "getting-started"}' https://api.github.com/authorizations
のようなものになります。
url = "https://api.github.com/authorizations"
HTTPoison.post!(url, [scopes: ["repo", "user"], note: "getting-started"], %{"X-GitHub-OTP" => "12345"})
それがエラーにこの
** (ArgumentError) argument error
:erlang.iolist_to_binary([{"scopes", ["repo", "user"]}, {"note", "getting-started"}])
(hackney) src/hackney_client/hackney_request.erl:338: :hackney_request.handle_body/4
(hackney) src/hackney_client/hackney_request.erl:79: :hackney_request.perform/2
のようなものを与え、誰かがそれを正しい方法を行う方法を教えてもらえます
HTTPoisonのマニュアルは、問題があなたにあるhere
keywork ':form'はnecessryですが、私は非常にあなたに感謝、ということを知りませんでした多く!!!!できます!私も 'ポイズン'を試してみる、あなたは本当に私の多くの時間を節約! –