This PR is larger than I expected because when I was looking at the HTTPoison source when I made my issue, I didn't realise I was only looking at the to_curl function :disappointed:, so apologies if this is bigger than expected.
When {:form, body} is passed as a body into HTTPoison, we iterate over all the keys in said body and iff a key contains a nested keyword-list, we apply the following transformation:
The function added supports arbitrarily deeply nested params, and should preserve the order in which things are passed in.
@edgurgel do you think we should extend this to support maps as well? It should be relatively minor (a change in the pattern matches) but then we'd throw the key-ordering guarantees away. WDYT?
_edit: Added a second commit that adds support for maps__
Ahoy again!
This PR is larger than I expected because when I was looking at the HTTPoison source when I made my issue, I didn't realise I was only looking at the
to_curl
function :disappointed:, so apologies if this is bigger than expected.When
{:form, body}
is passed as a body into HTTPoison, we iterate over all the keys in said body and iff a key contains a nested keyword-list, we apply the following transformation:The function added supports arbitrarily deeply nested params, and should preserve the order in which things are passed in.
@edgurgel do you think we should extend this to support maps as well? It should be relatively minor (a change in the pattern matches) but then we'd throw the key-ordering guarantees away. WDYT?_edit: Added a second commit that adds support for maps__Should fix https://github.com/edgurgel/httpoison/issues/469