mamantoha / crest

HTTP and REST client for Crystal
https://mamantoha.github.io/crest/
MIT License
235 stars 14 forks source link

allow nested params in cookies #149

Closed mamantoha closed 3 years ago

mamantoha commented 3 years ago

monkey-patch HTTP::Cookie to allow '[' and ']' in a cookie name

https://github.com/crystal-lang/crystal/issues/10983

Fixes:

url = "https://www.eway.in.ua/mobile_ajax/ua/lviv/stops"
headers = {"X-Requested-With" => "XMLHttpRequest"}
cookies = {"city" => {"key" => "lviv"}, "mobile_version" => 1, "lang" => "ua"}

response = Crest.get(url, headers: headers, cookies: cookies)