Claude 9868ae2e33 Implement HTTP client in consistent style with server.c
Refactored HTTP client implementation to follow the same coding
patterns and style as server.c:

- Added static helper functions (http_client_conn_init,
  http_client_conn_free, check_response_buffer, request_builder_to_conn)
- Implemented buffer limit setters (http_client_set_input_limit,
  http_client_set_output_limit)
- Fully implemented request builder API (url, header, body, send)
- Implemented event processing with state machine approach
- Added connection reuse support via http_free_response
- Used consistent naming, formatting, and error handling patterns
- Renamed builder_to_conn to request_builder_to_conn to avoid
  symbol conflicts with server.c during amalgamation

The implementation follows the same architecture as the server:
- Connection state machine for managing request/response lifecycle
- ByteQueue for input/output buffering
- Ready queue for completed responses
- Generation counters for builder validation
- Socket manager integration for async I/O
2025-11-21 19:17:18 +00:00
2025-11-21 15:12:32 +01:00
2025-11-21 12:53:03 +01:00
2025-11-21 12:53:03 +01:00
2025-11-21 19:52:28 +01:00
2025-11-21 12:53:03 +01:00

cHTTP

This is an HTTP library for C, featuring an HTTP(S) server, HTTP(S) client, and much more!

Contributing

Contributions are welcome! The following are some notes on how to work with the codebase. Don't worry if you get something wrong. I will remind you.

The source code in the src/ directory is intended to be be amalgamated into a single file before compilation. The amalgamation is not only intended as a distribution method, but also as easy-access documentation, and therefore need to be readable. For this reasons:

  1. You never need need to include other cHTTP source files
  2. All inclusions of third-party headers are to be placed inside src/includes.h
  3. All files must start with a single empty line, unless they start with an overview comment of the file, in which case they must have no empty lines at the beginning of the file.
  4. All files must end with a single empty line.
S
Description
Fully-featured HTTP(S) client and server in a single C file
Readme MIT
1.3 MiB
Languages
C 98.9%
Python 0.9%
Makefile 0.2%