Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add new HTTP::Headers constructors #2946

Closed

Conversation

Nephos
Copy link
Contributor

@Nephos Nephos commented Jul 2, 2016

Edit: found HTT::Headers{} method, so these constructors seems to be pretty useless :)

Hello, is this feature acceptable ?

  • Add HTTP::Headers#new(Hash(String, String))
    Work based on the same way than HTTP::Headers.[]=(String, String)
  • Add HTTP::Headers#new(Hash(String, Array(String)))
    Work based on the same way than HTTP::Headers.[]=(String, Array(String))
    It allows the construction of the HTTP::Headers without using []=

Example:

HTTP::Headers.new({"User-Agent" => "CrystalBot", "Accept-Language" => "en-US,en;q=0.5"})

Arthur Poulet added 2 commits July 2, 2016 20:56
* Add HTTP::Headers#new(Hash(String, String))
  Work based on the same way than HTTP::Headers.[]=(String, String)
* Add HTTP::Headers#new(Hash(String, Array(String)))
  Work based on the same way than HTTP::Headers.[]=(String,
  Array(String))
It allows the construction of the HTTP::Headers without using []=

Example:
HTTP::Headers.new({"User-Agent" => "CrystalBot", "Accept-Language" => "en-US,en;q=0.5"})
@Nephos Nephos closed this Jul 3, 2016
@Nephos Nephos deleted the http-headers-new-with-params branch July 7, 2016 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant