Skip to content
Snippets Groups Projects
Commit 4cf76012 authored by Roman Tsisyk's avatar Roman Tsisyk
Browse files

Add http.client.request() alias

Fix compatibility with original tarantool/http client.

Follow up #2530
parent 987e8cfd
No related branches found
No related tags found
No related merge requests found
......@@ -268,7 +268,7 @@ local function http_default_wrap(fname)
end
for _, name in ipairs({ 'get', 'delete', 'trace', 'options', 'head',
'connect', 'post', 'put', 'patch', }) do
'connect', 'post', 'put', 'patch', 'request'}) do
this_module[name] = http_default_wrap(name)
end
......
......@@ -50,7 +50,7 @@ end
local server, URL = start_server()
test:test("http.client", function(test)
test:plan(6)
test:plan(7)
local r = client.get(URL)
test:is(r.status, 200, 'simple 200')
......@@ -60,6 +60,9 @@ test:test("http.client", function(test)
test:ok(tonumber(r.headers["content-length"]) > 0,
"content-length > 0")
test:is(client.get("http://localhost:0/").status, 595, 'bad url')
local r = client.request('GET', URL)
test:is(r.status, 200, 'request')
end)
test:test("cancel and timeout", function(test)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment