aboutsummaryrefslogtreecommitdiff
path: root/core/io/http_client.cpp
diff options
context:
space:
mode:
authorMounir Ybanez2016-04-17 12:23:34 +0800
committerMounir Ybanez2016-04-18 17:16:15 +0800
commit0ca7e192423e743db3ded3822ae70888a523a35e (patch)
treef22dcd77c205dd9b5e7851a975b5bca0e8c8215c /core/io/http_client.cpp
parentbf0f9141409fd5f754c2b4e8dea0e5ea6f156896 (diff)
downloadgodot-0ca7e192423e743db3ded3822ae70888a523a35e.tar.gz
godot-0ca7e192423e743db3ded3822ae70888a523a35e.tar.zst
godot-0ca7e192423e743db3ded3822ae70888a523a35e.zip
Diffstat (limited to 'core/io/http_client.cpp')
-rw-r--r--core/io/http_client.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index e0c01c942..8c58e0ba5 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -81,6 +81,12 @@ void HTTPClient::set_connection(const Ref<StreamPeer>& p_connection){
}
+Ref<StreamPeer> HTTPClient::get_connection() const {
+
+ return connection;
+}
+
+
Error HTTPClient::request( Method p_method, const String& p_url, const Vector<String>& p_headers,const String& p_body) {
ERR_FAIL_INDEX_V(p_method,METHOD_MAX,ERR_INVALID_PARAMETER);
@@ -578,6 +584,7 @@ void HTTPClient::_bind_methods() {
ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true));
ObjectTypeDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection);
+ ObjectTypeDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection);
ObjectTypeDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String()));
ObjectTypeDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text);
ObjectTypeDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data);