comparison seobeo/seobeo_internal.h @ 119:c39582f937e5

[Seobeo Client] Added client side logic which will be used for all my other calls instead of curl.
author June Park <parkjune1995@gmail.com>
date Wed, 07 Jan 2026 16:05:57 -0800
parents 70401cf61e97
children cbbf78b17cfa
comparison
equal deleted inserted replaced
118:249881ceff7b 119:c39582f937e5
89 89
90 // --- Serving using Edge --- // 90 // --- Serving using Edge --- //
91 extern void *Seobeo_Web_Edge_Worker(void *vargs); 91 extern void *Seobeo_Web_Edge_Worker(void *vargs);
92 extern void Seobeo_Web_Edge(Seobeo_Handle *p_server_handle, int thread_count, Seobeo_Cache_Entry *p_html_cache); 92 extern void Seobeo_Web_Edge(Seobeo_Handle *p_server_handle, int thread_count, Seobeo_Cache_Entry *p_html_cache);
93 93
94 // --- HTTP Client Types --- //
95 typedef struct {
96 char *method;
97 char *url;
98 char *host;
99 char *port;
100 char *path;
101 boolean use_tls;
102
103 // Headers can be either HashMap or Array
104 Seobeo_Request_Entry *headers_map;
105 char **headers_array;
106
107 char *body;
108 size_t body_length;
109
110 boolean follow_redirects;
111 int32 max_redirects;
112
113 char *download_path;
114
115 Dowa_Arena *p_arena;
116 } Seobeo_Client_Request;
117
118 typedef struct {
119 int32 status_code;
120 char *status_text;
121
122 Seobeo_Request_Entry *headers;
123
124 char *body;
125 size_t body_length;
126
127 char *redirect_url;
128
129 Dowa_Arena *p_arena;
130 } Seobeo_Client_Response;
131
132 // --- HTTP Client Functions --- //
133 extern Seobeo_Client_Request *Seobeo_Client_Request_Create(const char *url);
134 extern void Seobeo_Client_Request_Set_Method(Seobeo_Client_Request *p_req, const char *method);
135 extern void Seobeo_Client_Request_Add_Header_Map(Seobeo_Client_Request *p_req, const char *key, const char *value);
136 extern void Seobeo_Client_Request_Add_Header_Array(Seobeo_Client_Request *p_req, const char *header);
137 extern void Seobeo_Client_Request_Set_Body(Seobeo_Client_Request *p_req, const char *body, size_t length);
138 extern void Seobeo_Client_Request_Set_Follow_Redirects(Seobeo_Client_Request *p_req, boolean follow, int32 max_redirects);
139 extern void Seobeo_Client_Request_Set_Download_Path(Seobeo_Client_Request *p_req, const char *path);
140 extern Seobeo_Client_Response *Seobeo_Client_Request_Execute(Seobeo_Client_Request *p_req);
141 extern void Seobeo_Client_Request_Destroy(Seobeo_Client_Request *p_req);
142 extern void Seobeo_Client_Response_Destroy(Seobeo_Client_Response *p_resp);
143
94 #endif 144 #endif