Include the `url' in the http client response.

This way, we can get the real url used by the lib, especially when there are query parameters.
This commit is contained in:
Jocelyn Fiat
2012-11-21 09:48:28 +01:00
parent 504e013a74
commit 86540814b3
2 changed files with 7 additions and 3 deletions

View File

@@ -13,11 +13,12 @@ create
feature {NONE} -- Initialization
make
make (a_url: like url)
-- Initialize `Current'.
do
--| Default values
status := 200
url := a_url
create {STRING_8} raw_header.make_empty
end
@@ -36,6 +37,9 @@ feature {HTTP_CLIENT_REQUEST} -- Status setting
feature -- Access
url: STRING_8
-- URL associated with Current response
status: INTEGER assign set_status
-- Status code of the response.

View File

@@ -207,7 +207,7 @@ feature -- Execution
create l_curl_string.make_empty
curl_easy.setopt_curl_string (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_writedata, l_curl_string)
create Result.make
create Result.make (l_url)
l_result := curl_easy.perform (curl_handle)
--| Result
@@ -224,7 +224,7 @@ feature -- Execution
curl.global_cleanup
curl_easy.cleanup (curl_handle)
else
create Result.make
create Result.make (url)
Result.set_error_occurred (True)
end