view playground/main.c @ 173:827c6ac504cd hg-web

Merged in default here.
author MrJuneJune <me@mrjunejune.com>
date Mon, 19 Jan 2026 18:59:10 -0800
parents 6de849867459 7387eec8e7f8
children
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);
}