Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 54a7fc3b79d0
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c79f437eb09c
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Oct 25, 2017

  1. Avoid misleading error when using HTTP::Client form options

    Restrict `Hash` types used by `post_form`, `put_form` and `patch_form`
    to avoid cryptic error messages when using a hash other than
    `Hash(String, String)`.
    
    Ref #5172
    Ref #5184
    luislavena committed Oct 25, 2017
    Copy the full SHA
    c5d8543 View commit details

Commits on Oct 26, 2017

  1. Merge pull request #5185 from luislavena/restrict-http-client-form-ha…

    …sh-types
    
    Avoid misleading error when using HTTP::Client form options
    asterite authored Oct 26, 2017
    Copy the full SHA
    c79f437 View commit details
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/http/client.cr
4 changes: 2 additions & 2 deletions src/http/client.cr
Original file line number Diff line number Diff line change
@@ -419,7 +419,7 @@ class HTTP::Client
# client = HTTP::Client.new "www.example.com"
# response = client.{{http_method.id}}_form "/", {"foo" => "bar"}
# ```
def {{http_method.id}}_form(path, form : Hash(String, _) | NamedTuple, headers : HTTP::Headers? = nil) : HTTP::Client::Response
def {{http_method.id}}_form(path, form : Hash(String, String) | NamedTuple, headers : HTTP::Headers? = nil) : HTTP::Client::Response
body = HTTP::Params.encode(form)
{{http_method.id}}_form path, body, headers
end
@@ -434,7 +434,7 @@ class HTTP::Client
# response.body_io.gets
# end
# ```
def {{http_method.id}}_form(path, form : Hash(String, _) | NamedTuple, headers : HTTP::Headers? = nil)
def {{http_method.id}}_form(path, form : Hash(String, String) | NamedTuple, headers : HTTP::Headers? = nil)
body = HTTP::Params.encode(form)
{{http_method.id}}_form(path, body, headers) do |response|
yield response