Added skeleton for Eiffel Net implementation of HTTP_CLIENT solution.

This is work in progress.
This commit is contained in:
2015-03-11 14:58:13 +01:00
parent 061e88c9fe
commit 29b55f36cf
10 changed files with 285 additions and 25 deletions

View File

@@ -1,6 +1,9 @@
note
description : "[
Specific implementation of HTTP_CLIENT based on Eiffel cURL library
WARNING: Do not forget to have the dynamic libraries libcurl (.dll or .so)
and related accessible to the executable (i.e in same directory, or in the PATH)
]"
author : "$Author$"
date : "$Date$"
@@ -13,6 +16,7 @@ inherit
HTTP_CLIENT
create
default_create,
make
feature {NONE} -- Initialization
@@ -20,6 +24,7 @@ feature {NONE} -- Initialization
make
-- Initialize `Current'.
do
default_create
end
feature -- Status
@@ -30,7 +35,7 @@ feature -- Status
end
note
copyright: "2011-2012, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -1,6 +1,9 @@
note
description: "[
Specific implementation of HTTP_CLIENT_REQUEST based on Eiffel cURL library
WARNING: Do not forget to have the dynamic libraries libcurl (.dll or .so)
and related accessible to the executable (i.e in same directory, or in the PATH)
]"
date: "$Date$"
revision: "$Revision$"
@@ -10,9 +13,8 @@ class
inherit
HTTP_CLIENT_REQUEST
rename
make as make_request
redefine
make,
session
end
@@ -23,8 +25,7 @@ feature {NONE} -- Initialization
make (a_url: READABLE_STRING_8; a_request_method: like request_method; a_session: like session; ctx: like context)
do
make_request (a_url, a_session, ctx)
request_method := a_request_method
Precursor (a_url, a_request_method, a_session, ctx)
apply_workaround
end
@@ -38,13 +39,10 @@ feature {NONE} -- Initialization
session: LIBCURL_HTTP_CLIENT_SESSION
feature -- Access
request_method: READABLE_STRING_8
feature -- Execution
execute: HTTP_CLIENT_RESPONSE
response: HTTP_CLIENT_RESPONSE
-- <Precursor>
local
l_result: INTEGER
l_curl_string: detachable CURL_STRING
@@ -390,7 +388,7 @@ feature {NONE} -- Implementation
end
note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software

View File

@@ -1,6 +1,9 @@
note
description: "[
Specific implementation of HTTP_CLIENT_SESSION based on Eiffel cURL library
WARNING: Do not forget to have the dynamic libraries libcurl (.dll or .so)
and related accessible to the executable (i.e in same directory, or in the PATH)
]"
date: "$Date$"
revision: "$Revision$"
@@ -38,7 +41,7 @@ feature -- Custom
req: HTTP_CLIENT_REQUEST
do
create {LIBCURL_HTTP_CLIENT_REQUEST} req.make (base_url + a_path, a_method, Current, ctx)
Result := req.execute
Result := req.response
end
custom_with_upload_data (a_method: READABLE_STRING_8; a_path: READABLE_STRING_8; a_ctx: detachable HTTP_CLIENT_REQUEST_CONTEXT; data: READABLE_STRING_8): HTTP_CLIENT_RESPONSE
@@ -140,7 +143,7 @@ feature {NONE} -- Implementation
end
create {LIBCURL_HTTP_CLIENT_REQUEST} req.make (base_url + a_path, a_method, Current, ctx)
Result := req.execute
Result := req.response
if f /= Void then
f.delete
@@ -161,7 +164,7 @@ feature {LIBCURL_HTTP_CLIENT_REQUEST} -- Curl implementation
;note
copyright: "2011-2013, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software