diff options
Diffstat (limited to 'core/io/http_client.h')
-rw-r--r-- | core/io/http_client.h | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/core/io/http_client.h b/core/io/http_client.h index 4b0c1b730f..e2b0e9ccea 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -29,17 +29,16 @@ #ifndef HTTP_CLIENT_H #define HTTP_CLIENT_H +#include "io/ip.h" #include "io/stream_peer.h" #include "io/stream_peer_tcp.h" -#include "io/ip.h" #include "reference.h" - class HTTPClient : public Reference { - GDCLASS(HTTPClient,Reference); -public: + GDCLASS(HTTPClient, Reference); +public: enum ResponseCode { // 1xx informational @@ -131,7 +130,6 @@ public: }; private: - Status status; IP::ResolverID resolving; int conn_port; @@ -159,21 +157,19 @@ private: Dictionary _get_response_headers_as_dictionary(); int read_chunk_size; - Error _get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received); + Error _get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received); public: - - //Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request - Error connect_to_host(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); + Error connect_to_host(const String &p_host, int p_port, bool p_ssl = false, bool p_verify_host = true); - void set_connection(const Ref<StreamPeer>& p_connection); + void set_connection(const Ref<StreamPeer> &p_connection); Ref<StreamPeer> get_connection() const; - Error request_raw( Method p_method, const String& p_url, const Vector<String>& p_headers,const PoolVector<uint8_t>& p_body); - Error request( Method p_method, const String& p_url, const Vector<String>& p_headers,const String& p_body=String()); - Error send_body_text(const String& p_body); - Error send_body_data(const PoolByteArray& p_body); + Error request_raw(Method p_method, const String &p_url, const Vector<String> &p_headers, const PoolVector<uint8_t> &p_body); + Error request(Method p_method, const String &p_url, const Vector<String> &p_headers, const String &p_body = String()); + Error send_body_text(const String &p_body); + Error send_body_data(const PoolByteArray &p_body); void close(); @@ -194,7 +190,7 @@ public: Error poll(); - String query_string_from_dict(const Dictionary& p_dict); + String query_string_from_dict(const Dictionary &p_dict); HTTPClient(); ~HTTPClient(); |