summaryrefslogtreecommitdiff
path: root/core/io/http_client.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-21 19:56:08 -0300
committerGitHub <noreply@github.com>2017-08-21 19:56:08 -0300
commit2cc83092498d3b82fa8a3aba37c32ad887d19c2c (patch)
tree4d2def0a62847170a86c3f134f234af8ae45f0b9 /core/io/http_client.cpp
parent92410df24cdf296ad63250274d69b2019996423e (diff)
parent32dd9a9f668db31e348c5ef5bc181cdb91c07299 (diff)
Merge pull request #10351 from neikeq/enums-are-for-the-weak
ClassDB: Provide the enum name of integer constants
Diffstat (limited to 'core/io/http_client.cpp')
-rw-r--r--core/io/http_client.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 4d5b88cfa1..1c35c6edeb 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -650,84 +650,84 @@ void HTTPClient::_bind_methods() {
ClassDB::bind_method(D_METHOD("query_string_from_dict", "fields"), &HTTPClient::query_string_from_dict);
- BIND_CONSTANT(METHOD_GET);
- BIND_CONSTANT(METHOD_HEAD);
- BIND_CONSTANT(METHOD_POST);
- BIND_CONSTANT(METHOD_PUT);
- BIND_CONSTANT(METHOD_DELETE);
- BIND_CONSTANT(METHOD_OPTIONS);
- BIND_CONSTANT(METHOD_TRACE);
- BIND_CONSTANT(METHOD_CONNECT);
- BIND_CONSTANT(METHOD_MAX);
-
- BIND_CONSTANT(STATUS_DISCONNECTED);
- BIND_CONSTANT(STATUS_RESOLVING); //resolving hostname (if passed a hostname)
- BIND_CONSTANT(STATUS_CANT_RESOLVE);
- BIND_CONSTANT(STATUS_CONNECTING); //connecting to ip
- BIND_CONSTANT(STATUS_CANT_CONNECT);
- BIND_CONSTANT(STATUS_CONNECTED); //connected ); requests only accepted here
- BIND_CONSTANT(STATUS_REQUESTING); // request in progress
- BIND_CONSTANT(STATUS_BODY); // request resulted in body ); which must be read
- BIND_CONSTANT(STATUS_CONNECTION_ERROR);
- BIND_CONSTANT(STATUS_SSL_HANDSHAKE_ERROR);
-
- BIND_CONSTANT(RESPONSE_CONTINUE);
- BIND_CONSTANT(RESPONSE_SWITCHING_PROTOCOLS);
- BIND_CONSTANT(RESPONSE_PROCESSING);
+ BIND_ENUM_CONSTANT(METHOD_GET);
+ BIND_ENUM_CONSTANT(METHOD_HEAD);
+ BIND_ENUM_CONSTANT(METHOD_POST);
+ BIND_ENUM_CONSTANT(METHOD_PUT);
+ BIND_ENUM_CONSTANT(METHOD_DELETE);
+ BIND_ENUM_CONSTANT(METHOD_OPTIONS);
+ BIND_ENUM_CONSTANT(METHOD_TRACE);
+ BIND_ENUM_CONSTANT(METHOD_CONNECT);
+ BIND_ENUM_CONSTANT(METHOD_MAX);
+
+ BIND_ENUM_CONSTANT(STATUS_DISCONNECTED);
+ BIND_ENUM_CONSTANT(STATUS_RESOLVING); //resolving hostname (if passed a hostname)
+ BIND_ENUM_CONSTANT(STATUS_CANT_RESOLVE);
+ BIND_ENUM_CONSTANT(STATUS_CONNECTING); //connecting to ip
+ BIND_ENUM_CONSTANT(STATUS_CANT_CONNECT);
+ BIND_ENUM_CONSTANT(STATUS_CONNECTED); //connected ); requests only accepted here
+ BIND_ENUM_CONSTANT(STATUS_REQUESTING); // request in progress
+ BIND_ENUM_CONSTANT(STATUS_BODY); // request resulted in body ); which must be read
+ BIND_ENUM_CONSTANT(STATUS_CONNECTION_ERROR);
+ BIND_ENUM_CONSTANT(STATUS_SSL_HANDSHAKE_ERROR);
+
+ BIND_ENUM_CONSTANT(RESPONSE_CONTINUE);
+ BIND_ENUM_CONSTANT(RESPONSE_SWITCHING_PROTOCOLS);
+ BIND_ENUM_CONSTANT(RESPONSE_PROCESSING);
// 2xx successful
- BIND_CONSTANT(RESPONSE_OK);
- BIND_CONSTANT(RESPONSE_CREATED);
- BIND_CONSTANT(RESPONSE_ACCEPTED);
- BIND_CONSTANT(RESPONSE_NON_AUTHORITATIVE_INFORMATION);
- BIND_CONSTANT(RESPONSE_NO_CONTENT);
- BIND_CONSTANT(RESPONSE_RESET_CONTENT);
- BIND_CONSTANT(RESPONSE_PARTIAL_CONTENT);
- BIND_CONSTANT(RESPONSE_MULTI_STATUS);
- BIND_CONSTANT(RESPONSE_IM_USED);
+ BIND_ENUM_CONSTANT(RESPONSE_OK);
+ BIND_ENUM_CONSTANT(RESPONSE_CREATED);
+ BIND_ENUM_CONSTANT(RESPONSE_ACCEPTED);
+ BIND_ENUM_CONSTANT(RESPONSE_NON_AUTHORITATIVE_INFORMATION);
+ BIND_ENUM_CONSTANT(RESPONSE_NO_CONTENT);
+ BIND_ENUM_CONSTANT(RESPONSE_RESET_CONTENT);
+ BIND_ENUM_CONSTANT(RESPONSE_PARTIAL_CONTENT);
+ BIND_ENUM_CONSTANT(RESPONSE_MULTI_STATUS);
+ BIND_ENUM_CONSTANT(RESPONSE_IM_USED);
// 3xx redirection
- BIND_CONSTANT(RESPONSE_MULTIPLE_CHOICES);
- BIND_CONSTANT(RESPONSE_MOVED_PERMANENTLY);
- BIND_CONSTANT(RESPONSE_FOUND);
- BIND_CONSTANT(RESPONSE_SEE_OTHER);
- BIND_CONSTANT(RESPONSE_NOT_MODIFIED);
- BIND_CONSTANT(RESPONSE_USE_PROXY);
- BIND_CONSTANT(RESPONSE_TEMPORARY_REDIRECT);
+ BIND_ENUM_CONSTANT(RESPONSE_MULTIPLE_CHOICES);
+ BIND_ENUM_CONSTANT(RESPONSE_MOVED_PERMANENTLY);
+ BIND_ENUM_CONSTANT(RESPONSE_FOUND);
+ BIND_ENUM_CONSTANT(RESPONSE_SEE_OTHER);
+ BIND_ENUM_CONSTANT(RESPONSE_NOT_MODIFIED);
+ BIND_ENUM_CONSTANT(RESPONSE_USE_PROXY);
+ BIND_ENUM_CONSTANT(RESPONSE_TEMPORARY_REDIRECT);
// 4xx client error
- BIND_CONSTANT(RESPONSE_BAD_REQUEST);
- BIND_CONSTANT(RESPONSE_UNAUTHORIZED);
- BIND_CONSTANT(RESPONSE_PAYMENT_REQUIRED);
- BIND_CONSTANT(RESPONSE_FORBIDDEN);
- BIND_CONSTANT(RESPONSE_NOT_FOUND);
- BIND_CONSTANT(RESPONSE_METHOD_NOT_ALLOWED);
- BIND_CONSTANT(RESPONSE_NOT_ACCEPTABLE);
- BIND_CONSTANT(RESPONSE_PROXY_AUTHENTICATION_REQUIRED);
- BIND_CONSTANT(RESPONSE_REQUEST_TIMEOUT);
- BIND_CONSTANT(RESPONSE_CONFLICT);
- BIND_CONSTANT(RESPONSE_GONE);
- BIND_CONSTANT(RESPONSE_LENGTH_REQUIRED);
- BIND_CONSTANT(RESPONSE_PRECONDITION_FAILED);
- BIND_CONSTANT(RESPONSE_REQUEST_ENTITY_TOO_LARGE);
- BIND_CONSTANT(RESPONSE_REQUEST_URI_TOO_LONG);
- BIND_CONSTANT(RESPONSE_UNSUPPORTED_MEDIA_TYPE);
- BIND_CONSTANT(RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE);
- BIND_CONSTANT(RESPONSE_EXPECTATION_FAILED);
- BIND_CONSTANT(RESPONSE_UNPROCESSABLE_ENTITY);
- BIND_CONSTANT(RESPONSE_LOCKED);
- BIND_CONSTANT(RESPONSE_FAILED_DEPENDENCY);
- BIND_CONSTANT(RESPONSE_UPGRADE_REQUIRED);
+ BIND_ENUM_CONSTANT(RESPONSE_BAD_REQUEST);
+ BIND_ENUM_CONSTANT(RESPONSE_UNAUTHORIZED);
+ BIND_ENUM_CONSTANT(RESPONSE_PAYMENT_REQUIRED);
+ BIND_ENUM_CONSTANT(RESPONSE_FORBIDDEN);
+ BIND_ENUM_CONSTANT(RESPONSE_NOT_FOUND);
+ BIND_ENUM_CONSTANT(RESPONSE_METHOD_NOT_ALLOWED);
+ BIND_ENUM_CONSTANT(RESPONSE_NOT_ACCEPTABLE);
+ BIND_ENUM_CONSTANT(RESPONSE_PROXY_AUTHENTICATION_REQUIRED);
+ BIND_ENUM_CONSTANT(RESPONSE_REQUEST_TIMEOUT);
+ BIND_ENUM_CONSTANT(RESPONSE_CONFLICT);
+ BIND_ENUM_CONSTANT(RESPONSE_GONE);
+ BIND_ENUM_CONSTANT(RESPONSE_LENGTH_REQUIRED);
+ BIND_ENUM_CONSTANT(RESPONSE_PRECONDITION_FAILED);
+ BIND_ENUM_CONSTANT(RESPONSE_REQUEST_ENTITY_TOO_LARGE);
+ BIND_ENUM_CONSTANT(RESPONSE_REQUEST_URI_TOO_LONG);
+ BIND_ENUM_CONSTANT(RESPONSE_UNSUPPORTED_MEDIA_TYPE);
+ BIND_ENUM_CONSTANT(RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE);
+ BIND_ENUM_CONSTANT(RESPONSE_EXPECTATION_FAILED);
+ BIND_ENUM_CONSTANT(RESPONSE_UNPROCESSABLE_ENTITY);
+ BIND_ENUM_CONSTANT(RESPONSE_LOCKED);
+ BIND_ENUM_CONSTANT(RESPONSE_FAILED_DEPENDENCY);
+ BIND_ENUM_CONSTANT(RESPONSE_UPGRADE_REQUIRED);
// 5xx server error
- BIND_CONSTANT(RESPONSE_INTERNAL_SERVER_ERROR);
- BIND_CONSTANT(RESPONSE_NOT_IMPLEMENTED);
- BIND_CONSTANT(RESPONSE_BAD_GATEWAY);
- BIND_CONSTANT(RESPONSE_SERVICE_UNAVAILABLE);
- BIND_CONSTANT(RESPONSE_GATEWAY_TIMEOUT);
- BIND_CONSTANT(RESPONSE_HTTP_VERSION_NOT_SUPPORTED);
- BIND_CONSTANT(RESPONSE_INSUFFICIENT_STORAGE);
- BIND_CONSTANT(RESPONSE_NOT_EXTENDED);
+ BIND_ENUM_CONSTANT(RESPONSE_INTERNAL_SERVER_ERROR);
+ BIND_ENUM_CONSTANT(RESPONSE_NOT_IMPLEMENTED);
+ BIND_ENUM_CONSTANT(RESPONSE_BAD_GATEWAY);
+ BIND_ENUM_CONSTANT(RESPONSE_SERVICE_UNAVAILABLE);
+ BIND_ENUM_CONSTANT(RESPONSE_GATEWAY_TIMEOUT);
+ BIND_ENUM_CONSTANT(RESPONSE_HTTP_VERSION_NOT_SUPPORTED);
+ BIND_ENUM_CONSTANT(RESPONSE_INSUFFICIENT_STORAGE);
+ BIND_ENUM_CONSTANT(RESPONSE_NOT_EXTENDED);
}
void HTTPClient::set_read_chunk_size(int p_size) {