Skip to content

Commit

Permalink
User-Agent should be properly capitalized in exec
Browse files Browse the repository at this point in the history
  • Loading branch information
dylandrop authored and asterite committed Feb 15, 2017
1 parent f0770cd commit ee3baad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/http/client.cr
Expand Up @@ -332,7 +332,7 @@ class HTTP::Client
#
# ```
# client = HTTP::Client.new("www.example.com")
# response = client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!")
# response = client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
# response.body #=> "..."
# ```
def {{method.id}}(path, headers : HTTP::Headers? = nil, body : BodyType = nil) : HTTP::Client::Response
Expand All @@ -344,7 +344,7 @@ class HTTP::Client
#
# ```
# client = HTTP::Client.new("www.example.com")
# client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!") do |response|
# client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!") do |response|
# response.body_io.gets #=> "..."
# end
# ```
Expand All @@ -358,7 +358,7 @@ class HTTP::Client
# The response will have its body as a `String`, accessed via `HTTP::Client::Response#body`.
#
# ```
# response = HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!")
# response = HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!")
# response.body #=> "..."
# ```
def self.{{method.id}}(url : String | URI, headers : HTTP::Headers? = nil, body : BodyType = nil, tls = nil) : HTTP::Client::Response
Expand All @@ -369,7 +369,7 @@ class HTTP::Client
# The response will have its body as an `IO` accessed via `HTTP::Client::Response#body_io`.
#
# ```
# HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-agent" => "AwesomeApp"}, body: "Hello!") do |response|
# HTTP::Client.{{method.id}}("/", headers: HTTP::Headers{"User-Agent" => "AwesomeApp"}, body: "Hello!") do |response|
# response.body_io.gets #=> "..."
# end
# ```
Expand Down Expand Up @@ -561,7 +561,7 @@ class HTTP::Client
end

private def set_defaults(request)
request.headers["User-agent"] ||= "Crystal"
request.headers["User-Agent"] ||= "Crystal"
{% if flag?(:without_zlib) %}
false
{% else %}
Expand Down

0 comments on commit ee3baad

Please sign in to comment.