32 #include "io/stream_peer.h" 33 #include "io/stream_peer_tcp.h" 35 #include "reference.h" 46 RESPONSE_CONTINUE = 100,
47 RESPONSE_SWITCHING_PROTOCOLS = 101,
48 RESPONSE_PROCESSING = 102,
52 RESPONSE_CREATED = 201,
53 RESPONSE_ACCEPTED = 202,
54 RESPONSE_NON_AUTHORITATIVE_INFORMATION = 203,
55 RESPONSE_NO_CONTENT = 204,
56 RESPONSE_RESET_CONTENT = 205,
57 RESPONSE_PARTIAL_CONTENT = 206,
58 RESPONSE_MULTI_STATUS = 207,
59 RESPONSE_IM_USED = 226,
62 RESPONSE_MULTIPLE_CHOICES = 300,
63 RESPONSE_MOVED_PERMANENTLY = 301,
65 RESPONSE_SEE_OTHER = 303,
66 RESPONSE_NOT_MODIFIED = 304,
67 RESPONSE_USE_PROXY = 305,
68 RESPONSE_TEMPORARY_REDIRECT = 307,
71 RESPONSE_BAD_REQUEST = 400,
72 RESPONSE_UNAUTHORIZED = 401,
73 RESPONSE_PAYMENT_REQUIRED = 402,
74 RESPONSE_FORBIDDEN = 403,
75 RESPONSE_NOT_FOUND = 404,
76 RESPONSE_METHOD_NOT_ALLOWED = 405,
77 RESPONSE_NOT_ACCEPTABLE = 406,
78 RESPONSE_PROXY_AUTHENTICATION_REQUIRED = 407,
79 RESPONSE_REQUEST_TIMEOUT = 408,
80 RESPONSE_CONFLICT = 409,
82 RESPONSE_LENGTH_REQUIRED = 411,
83 RESPONSE_PRECONDITION_FAILED = 412,
84 RESPONSE_REQUEST_ENTITY_TOO_LARGE = 413,
85 RESPONSE_REQUEST_URI_TOO_LONG = 414,
86 RESPONSE_UNSUPPORTED_MEDIA_TYPE = 415,
87 RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE = 416,
88 RESPONSE_EXPECTATION_FAILED = 417,
89 RESPONSE_UNPROCESSABLE_ENTITY = 422,
90 RESPONSE_LOCKED = 423,
91 RESPONSE_FAILED_DEPENDENCY = 424,
92 RESPONSE_UPGRADE_REQUIRED = 426,
95 RESPONSE_INTERNAL_SERVER_ERROR = 500,
96 RESPONSE_NOT_IMPLEMENTED = 501,
97 RESPONSE_BAD_GATEWAY = 502,
98 RESPONSE_SERVICE_UNAVAILABLE = 503,
99 RESPONSE_GATEWAY_TIMEOUT = 504,
100 RESPONSE_HTTP_VERSION_NOT_SUPPORTED = 505,
101 RESPONSE_INSUFFICIENT_STORAGE = 507,
102 RESPONSE_NOT_EXTENDED = 510,
128 STATUS_CONNECTION_ERROR,
129 STATUS_SSL_HANDSHAKE_ERROR,
136 IP::ResolverID resolving;
140 bool ssl_verify_host;
157 static void _bind_methods();
159 Dictionary _get_response_headers_as_dictionary();
162 Error _get_http_data(uint8_t* p_buffer,
int p_bytes,
int &r_received);
167 Error connect_url(
const String& p_url);
168 Error connect(
const String &p_host,
int p_port,
bool p_ssl=
false,
bool p_verify_host=
true);
173 Error send_body_text(
const String& p_body);
174 Error send_body_data(
const ByteArray& p_body);
178 Status get_status()
const;
180 bool has_response()
const;
181 bool is_response_chunked()
const;
182 int get_response_code()
const;
184 int get_response_body_length()
const;
188 void set_blocking_mode(
bool p_enable);
189 bool is_blocking_mode_enabled()
const;
191 void set_read_chunk_size(
int p_size);
201 VARIANT_ENUM_CAST(HTTPClient::Method);
203 #endif // HTTP_CLIENT_H
Definition: reference.h:40
Definition: dictionary.h:42
Definition: http_client.h:38