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:
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user