mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-09-01 00:00:35 -04:00
do not allow the request methods to be called without URIs (closes #29)
This commit is contained in:
parent
bb89d1230e
commit
c79987f76c
@ -69,7 +69,7 @@ module HTTPX
|
||||
end
|
||||
|
||||
def __build_reqs(*args, **options)
|
||||
case args.size
|
||||
requests = case args.size
|
||||
when 1
|
||||
reqs = args.first
|
||||
reqs.map do |verb, uri|
|
||||
@ -87,6 +87,8 @@ module HTTPX
|
||||
else
|
||||
raise ArgumentError, "unsupported number of arguments"
|
||||
end
|
||||
raise ArgumentError, "wrong number of URIs (given 0, expect 1..+1)" if requests.empty?
|
||||
requests
|
||||
end
|
||||
|
||||
def __send_reqs(*requests, **options)
|
||||
|
Loading…
x
Reference in New Issue
Block a user