/* http_client.h — minimal blocking HTTP/HTTPS GET client. * * Used by the web UI for RSS feed polling and Torznab indexer search. Supports * plain HTTP and TLS (via OpenSSL), follows redirects, and returns the decoded * response body. Intended for occasional fetches off the hot path. */ #ifndef NAUT_HTTP_CLIENT_H #define NAUT_HTTP_CLIENT_H #include #include "naut/common.h" typedef struct { long status; /* HTTP status code (e.g. 200) */ char *body; /* malloc'd, NUL-terminated response body */ size_t body_len; /* length of body, excluding the NUL */ } naut_http_response; /* GET `url` (http:// or https://), following up to a handful of redirects. * On NAUT_OK, `out` owns `out->body` (free with naut_http_response_free). * Returns NAUT_ERR_* on transport/protocol failure. A non-2xx HTTP status is * still returned as NAUT_OK with out->status set, so callers can inspect it. */ naut_err naut_http_get(const char *url, naut_http_response *out); void naut_http_response_free(naut_http_response *r); #endif /* NAUT_HTTP_CLIENT_H */