-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha_https.inc
More file actions
52 lines (46 loc) · 1.61 KB
/
a_https.inc
File metadata and controls
52 lines (46 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma library https
#define HTTPS_GET 1
#define HTTPS_POST 2
#define HTTPS_HEAD 3
#define HTTPS_ERROR_NONE 0
#define HTTPS_ERROR_BAD_URL 1
#define HTTPS_ERROR_TLS_HANDSHAKE 2
#define HTTPS_ERROR_NO_SOCKET 3
#define HTTPS_ERROR_CANT_CONNECT 4
#define HTTPS_ERROR_SEND_FAIL 5
#define HTTPS_ERROR_CONTENT_TOO_BIG 6
#define HTTPS_ERROR_TIMEOUT 7
#define HTTPS_ERROR_POLICY_BLOCKED 8
#define HTTPS_ERROR_UNKNOWN 10
native https(index, type, url[], data[], callback[]);
native https_set_header(const key[], const value[]);
native https_set_global_header(const key[], const value[]);
native https_bodyf(const data[]);
native https_jsonf(const data[]);
native https_form_add(const key[], const value[]);
native https_clear_global_headers();
native https_process_queue();
native https_queue_len();
native https_set_max_body_bytes(bytes);
native https_get_max_body_bytes();
native https_allow_cross_host_once(bool:enable);
native https_mtls_set_pem(const pem[]);
native https_mtls_set_pem_file(const path[]);
native https_mtls_clear();
forward ProcessHTTPSQueue();
public ProcessHTTPSQueue()
{
https_process_queue();
return 1;
}
// Exemplo de uso:
// OnGameModeInit:
// printf("HTTPS queue inicial: %d", https_queue_len());
// https_set_max_body_bytes(32768); // 32 KiB
// SetTimer("ProcessHTTPSQueue", 100, true);
//
// Callback esperado:
// public MeuCallback(index, response[], status, error)
// {
// printf("idx=%d status=%d err=%d len=%d", index, status, error, strlen(response));
// }