-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Description
This new method:
Line 316 in 7bcb6f5
| request(a...; kw...)::Response = return request(HTTP.stack(;kw...), a...; kw...) |
Lines 306 to 314 in 7bcb6f5
| function request(stack::Type{<:Layer}, method, url, h=Header[], b=nobody; | |
| headers=h, body=b, query=nothing, kw...)::Response | |
| uri = URI(url) | |
| if query !== nothing | |
| uri = merge(uri, query=query) | |
| end | |
| return request(stack, string(method), uri, mkheaders(headers), body; kw...) | |
| end |
headers kwargs etc. But that does not happen, because we dispatch to HTTP.jl/src/RedirectRequest.jl
Line 18 in 7bcb6f5
| function request(::Type{RedirectLayer{Next}}, |
headers (it is included in kwargs...).
Here is an example, where headers is ignored:
julia> using HTTP
julia> uri = HTTP.URI("https://api.github.com");
julia> headers=Dict("User-Agent" => "HTTP.jl");
julia> HTTP.request("GET", uri; headers=headers)
ERROR: HTTP.ExceptionRequest.StatusError(403, "GET", "/", HTTP.Messages.Response:
"""
HTTP/1.0 403 Forbidden
Cache-Control: no-cache
Connection: close
Content-Type: text/html
Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes.
""")
Metadata
Metadata
Assignees
Labels
No labels