Skip to content

Commit

Permalink
query= kw arg
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jan 18, 2018
1 parent c8f0ff4 commit 57ff747
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/HTTP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ HTTP.put("http://httpbin.org/put", [], "Hello"; conf..)
```
URL options
- `query = nothing`, replaces the query part of `url`.
Streaming options
- `response_stream = nothing`, a writeable `IO` stream or any `IO`-like
Expand Down Expand Up @@ -286,8 +290,15 @@ request(method::String, url::URI, headers::Headers, body; kw...)::Response =

const nobody = UInt8[]

request(method, url, h=Header[], b=nobody; headers=h, body=b, kw...)::Response =
request(string(method), URI(url), mkheaders(headers), body; kw...)
function request(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(string(method), uri, mkheaders(headers), body; kw...)
end


"""
Expand Down

0 comments on commit 57ff747

Please sign in to comment.