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
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
make
|
make (a_url: like url)
|
||||||
-- Initialize `Current'.
|
-- Initialize `Current'.
|
||||||
do
|
do
|
||||||
--| Default values
|
--| Default values
|
||||||
status := 200
|
status := 200
|
||||||
|
url := a_url
|
||||||
create {STRING_8} raw_header.make_empty
|
create {STRING_8} raw_header.make_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -36,6 +37,9 @@ feature {HTTP_CLIENT_REQUEST} -- Status setting
|
|||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
|
url: STRING_8
|
||||||
|
-- URL associated with Current response
|
||||||
|
|
||||||
status: INTEGER assign set_status
|
status: INTEGER assign set_status
|
||||||
-- Status code of the response.
|
-- Status code of the response.
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ feature -- Execution
|
|||||||
create l_curl_string.make_empty
|
create l_curl_string.make_empty
|
||||||
curl_easy.setopt_curl_string (curl_handle, {CURL_OPT_CONSTANTS}.curlopt_writedata, l_curl_string)
|
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)
|
l_result := curl_easy.perform (curl_handle)
|
||||||
|
|
||||||
--| Result
|
--| Result
|
||||||
@@ -224,7 +224,7 @@ feature -- Execution
|
|||||||
curl.global_cleanup
|
curl.global_cleanup
|
||||||
curl_easy.cleanup (curl_handle)
|
curl_easy.cleanup (curl_handle)
|
||||||
else
|
else
|
||||||
create Result.make
|
create Result.make (url)
|
||||||
Result.set_error_occurred (True)
|
Result.set_error_occurred (True)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user