Skip to content

Fails entirely if an array of params is passed instead of a hash #47

Description

@joshgoebel
payload = [
  ["task[title]", "This is the title"],
  ["task[attachments][][file]", File.open("test.png")],
  ["task[attachments][][file]", File.open("test2.png")],
]
post("/tasks/new", :query => payload)

Inside HTTParty body fails to call query_string_normalizer at all if it's not dealing with a hash... so the files get "converted" to raw inspect strings (i.e., "#<File ...>") and passed over the wire as such - which of course isn't going to work.

Replacing the array with the equivalent hash solves the issue but since array is a supported way of passing params this should probably "just work" properly without users needing to change the class of the params.

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions