Added first support for persistent connection in NET http client implementation.

Various improvement related to eventual errors.
This commit is contained in:
2015-09-16 22:51:58 +02:00
parent 65b28ed877
commit b69b8aaaf9
8 changed files with 326 additions and 74 deletions

View File

@@ -37,6 +37,50 @@ feature -- Tests
test_headers
end
test_persistent_connection
local
sess: like new_session
h: STRING_8
do
sess := new_session ("http://www.google.fr")
if attached sess.get ("/", Void) as res then
assert ("Get returned without error", not res.error_occurred)
create h.make_empty
if attached res.headers as hds then
across
hds as c
loop
h.append (c.item.name + ": " + c.item.value + "%R%N")
end
end
if attached res.body as l_body then
assert ("body not empty", not l_body.is_empty)
else
assert ("missing body", False)
end
assert ("same headers", h.same_string (res.raw_header))
end
if attached sess.get ("/", Void) as res then
assert ("Get returned without error", not res.error_occurred)
create h.make_empty
if attached res.headers as hds then
across
hds as c
loop
h.append (c.item.name + ": " + c.item.value + "%R%N")
end
end
if attached res.body as l_body then
assert ("body not empty", not l_body.is_empty)
else
assert ("missing body", False)
end
assert ("same headers", h.same_string (res.raw_header))
end
sess.close
end
end