Skip to content

Commit

Permalink
add HTTP OPTIONS method to HTTP::Client
Browse files Browse the repository at this point in the history
  • Loading branch information
mamantoha authored and ysbaddaden committed Mar 14, 2018
1 parent 52fa3b2 commit 863f301
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/std/http/client/client_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module HTTP
typeof(Client.new(URI.new))
typeof(Client.new(URI.parse("http://www.example.com")))

{% for method in %w(get post put head delete patch) %}
{% for method in %w(get post put head delete patch options) %}
typeof(Client.{{method.id}} "url")
typeof(Client.new("host").{{method.id}}("uri"))
typeof(Client.new("host").{{method.id}}("uri", headers: Headers {"Content-Type" => "text/plain"}))
Expand Down
2 changes: 1 addition & 1 deletion src/http/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class HTTP::Client
before_request << callback
end

{% for method in %w(get post put head delete patch) %}
{% for method in %w(get post put head delete patch options) %}
# Executes a {{method.id.upcase}} request.
# The response will have its body as a `String`, accessed via `HTTP::Client::Response#body`.
#
Expand Down

0 comments on commit 863f301

Please sign in to comment.