PassiveSupport.PostBody (passive_support v0.8.0)
Link to this section Summary
Functions
Deep-parses the map into a string formatted according to the www-form-urlencoded
spec.
Link to this section Functions
Link to this function
parse_form_data(enum)
Specs
Deep-parses the map into a string formatted according to the www-form-urlencoded
spec.
Examples
iex> parse_form_data(%{
...> "success_url" => "https://localhost:4001/foo/bert?id={ID}",
...> "cancel_url" => "https://localhost:4001/foo/bar",
...> "payment_types" => ["cash", "card", "cheque"],
...> "line_items" => [%{"price" => "five dollars", "quantity" => 1}, %{"line" => "line", "item" => "item"}],
...> "mode" => "subscription",
...> "just_to_make_sure" => %{
...> "we got" => "all", "the edge" => "cases", "we can think of" => "covered"
...> }
...> })
~S(cancel_url="https://localhost:4001/foo/bar"&just_to_make_sure[the+edge]=cases&just_to_make_sure[we+can+think+of]=covered&just_to_make_sure[we+got]=all&line_items[0][price]=five+dollars&line_items[0][quantity]=1&line_items[1][item]=item&line_items[1][line]=line&mode=subscription&payment_types[0]=cash&payment_types[1]=card&payment_types[2]=cheque&success_url="https://localhost:4001/foo/bert?id={ID}")
iex> parse_form_data(%{something: :dotcom})
"something=dotcom"