view playground/main.c @ 147:6de849867459 hg-web

[HgWeb] Updated logic to use Seobeo Client.
author June Park <parkjune1995@gmail.com>
date Fri, 09 Jan 2026 18:39:34 -0800
parents 893d87124d16
children 827c6ac504cd
line wrap: on
line source

#include "seobeo/seobeo.h"

int main(int argc, char *argv[])
{
  Seobeo_Client_Request *p_req = Seobeo_Client_Request_Create("http://127.0.0.1:4444/file/tip?style=json");
  Seobeo_Client_Request_Add_Header_Array(p_req, "User-Agent: Seobeo/1.0 (Array Mode)");
  Seobeo_Client_Request_Add_Header_Array(p_req, "Accept: application/json");
  Seobeo_Client_Request_Add_Header_Array(p_req, "X-Test-Header: TestValue");
  Seobeo_Client_Response *p_resp = Seobeo_Client_Request_Execute(p_req);
  if (p_resp)
  {
    printf("Status: %d\n", p_resp->status_code);
    if (p_resp->body)
      printf("Response:\n%s\n", p_resp->body);
    Seobeo_Client_Response_Destroy(p_resp);
  }
  else
    printf("Request failed\n");
  Seobeo_Client_Request_Destroy(p_req);
}