From 27ee20f99b8a980700ef4a7217e2839fe3ab3db7 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Tue, 11 Jul 2017 23:29:42 +0200 Subject: [PATCH] Added convenient `get` and `custom` functions on HTTP_CLIENT directly. --- library/network/http_client/src/http_client.e | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/library/network/http_client/src/http_client.e b/library/network/http_client/src/http_client.e index 2b3ba358..a75a9620 100644 --- a/library/network/http_client/src/http_client.e +++ b/library/network/http_client/src/http_client.e @@ -16,8 +16,19 @@ feature -- Access deferred end + get (a_url: READABLE_STRING_8; ctx: detachable HTTP_CLIENT_REQUEST_CONTEXT): HTTP_CLIENT_RESPONSE + do + Result := new_session (a_url).get ("", ctx) + end + + custom (a_method: READABLE_STRING_8; a_url: READABLE_STRING_8; ctx: detachable HTTP_CLIENT_REQUEST_CONTEXT): HTTP_CLIENT_RESPONSE + -- Response for `a_method' request based on `a_url' and optional `ctx'. + do + Result := new_session (a_url).custom (a_method, "", ctx) + end + note - copyright: "2011-2015, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" + copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software