Kore
Loading...
Searching...
No Matches
http.h
Go to the documentation of this file.
1#pragma once
2
3#include <kinc/global.h>
4
5#include <stdbool.h>
6
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define KINC_HTTP_GET 0
16#define KINC_HTTP_POST 1
17#define KINC_HTTP_PUT 2
18#define KINC_HTTP_DELETE 3
19
20typedef void (*kinc_http_callback_t)(int error, int response, const char *body, void *callbackdata);
21
25KINC_FUNC void kinc_http_request(const char *url, const char *path, const char *data, int port, bool secure, int method, const char *header,
26 kinc_http_callback_t callback, void *callbackdata);
27
28#ifdef KINC_IMPLEMENTATION_NETWORK
29#define KINC_IMPLEMENTATION
30#endif
31
32#ifdef KINC_IMPLEMENTATION
33
34#if !defined KINC_MACOS && !defined KINC_IOS && !defined KINC_WINDOWS
35
36#include <assert.h>
37
38void kinc_http_request(const char *url, const char *path, const char *data, int port, bool secure, int method, const char *header,
39 kinc_http_callback_t callback, void *callbackdata) {
40 assert(false); // not implemented for the current system, please send a pull-request
41}
42
43#endif
44
45#endif
46
47#ifdef __cplusplus
48}
49#endif
Provides basic functionality that's used all over the place. There's usually no need to manually incl...
KINC_FUNC void kinc_http_request(const char *url, const char *path, const char *data, int port, bool secure, int method, const char *header, kinc_http_callback_t callback, void *callbackdata)
Fires off an http request.