Mercurial
diff 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 |
line wrap: on
line diff
--- a/seobeo/seobeo_internal.h Wed Jan 07 13:24:38 2026 -0800 +++ b/seobeo/seobeo_internal.h Wed Jan 07 16:05:57 2026 -0800 @@ -91,4 +91,54 @@ extern void *Seobeo_Web_Edge_Worker(void *vargs); extern void Seobeo_Web_Edge(Seobeo_Handle *p_server_handle, int thread_count, Seobeo_Cache_Entry *p_html_cache); +// --- HTTP Client Types --- // +typedef struct { + char *method; + char *url; + char *host; + char *port; + char *path; + boolean use_tls; + + // Headers can be either HashMap or Array + Seobeo_Request_Entry *headers_map; + char **headers_array; + + char *body; + size_t body_length; + + boolean follow_redirects; + int32 max_redirects; + + char *download_path; + + Dowa_Arena *p_arena; +} Seobeo_Client_Request; + +typedef struct { + int32 status_code; + char *status_text; + + Seobeo_Request_Entry *headers; + + char *body; + size_t body_length; + + char *redirect_url; + + Dowa_Arena *p_arena; +} Seobeo_Client_Response; + +// --- HTTP Client Functions --- // +extern Seobeo_Client_Request *Seobeo_Client_Request_Create(const char *url); +extern void Seobeo_Client_Request_Set_Method(Seobeo_Client_Request *p_req, const char *method); +extern void Seobeo_Client_Request_Add_Header_Map(Seobeo_Client_Request *p_req, const char *key, const char *value); +extern void Seobeo_Client_Request_Add_Header_Array(Seobeo_Client_Request *p_req, const char *header); +extern void Seobeo_Client_Request_Set_Body(Seobeo_Client_Request *p_req, const char *body, size_t length); +extern void Seobeo_Client_Request_Set_Follow_Redirects(Seobeo_Client_Request *p_req, boolean follow, int32 max_redirects); +extern void Seobeo_Client_Request_Set_Download_Path(Seobeo_Client_Request *p_req, const char *path); +extern Seobeo_Client_Response *Seobeo_Client_Request_Execute(Seobeo_Client_Request *p_req); +extern void Seobeo_Client_Request_Destroy(Seobeo_Client_Request *p_req); +extern void Seobeo_Client_Response_Destroy(Seobeo_Client_Response *p_resp); + #endif