rest-client / rest-client

Simple HTTP and REST client for Ruby, inspired by microframework syntax for specifying actions.

Home Page:https://rubydoc.info/github/rest-client/rest-client/master

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add the ability to alphabetically sort query string parameters

wowinter13 opened this issue · comments

Currently Utils.encode_query_string serializes an object into string using default order:

Utils.encode_query_string({a: 2, c: 3, b: 1}) # a=2&c=3&b=1

But it would be nice to add the ability to sort query string ascending (maybe by default, like it was done in Httparty or ActiveSupport to_query).

Personally for me it was important, when I coded gem using rest-client and there was a need to generate MD5 from query params sorted alphabetically.