Conditionally process :form
bodies to handle nested params
#470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 😞, 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 #469