ZHTTP_CLIENT(3)
π ZHTTP_CLIENT(3) β the CZMQ manual, bestie edition π
okay so welcome to the zhttp_client page from the CZMQ Manual, and no cap, this one's a little baby draft that's still figuring itself out. Grab a strawberry π, let's get into it.
β¨ NAME β¨
zhttp_client β a whole class that provides a simple http client. it's giving "small but mighty", fr fr.
π SYNOPSIS π
so first things first, this is a draft class, and it may change without notice. it is disabled in stable builds by default. if you use this in applications, please ask for it to be pushed to stable state. use --enable-drafts to enable. iykyk π
// This is a draft class, and may change without notice. It is disabled in
// stable builds by default. If you use this in applications, please ask
// for it to be pushed to stable state. Use --enable-drafts to enable.
#ifdef CZMQ_BUILD_DRAFT_API
// *** Draft method, for development use, may change without warning ***
// Create a new http client
CZMQ_EXPORT zhttp_client_t *
zhttp_client_new (bool verbose);
// *** Draft method, for development use, may change without warning ***
// Destroy an http client
CZMQ_EXPORT void
zhttp_client_destroy (zhttp_client_t **self_p);
// *** Draft method, for development use, may change without warning ***
// Self test of this class.
CZMQ_EXPORT void
zhttp_client_test (bool verbose);
#endif // CZMQ_BUILD_DRAFT_API
and then there's this little note, verbatim, because i'm not gatekeeping:
Please add '@interface' section in './../src/zhttp_client.c'.
π«Ά yes bestie, every one of those three methods is a draft method, for development use, may change without warning. do not build your whole personality on them yet.
π¦ DESCRIPTION π¦
zhttp_client β provides a simple http client. that's the whole vibe. main character energy, minimal words. β¨
and then, straight from the source, no edits:
Please add @discuss section in ./../src/zhttp_client.c.
π the manpage is literally begging for a discussion section. not me reading a TODO in the docs. iconic honestly.
π EXAMPLE π
this one comes straight from the zhttp_client_test method. slay, let's read it together:
zhttp_client_t *self = zhttp_client_new (verbose);
assert (self);
zhttp_request_t* request = zhttp_request_new ();
zhttp_request_set_url (request, url);
zhttp_request_set_method (request, "GET");
int rc = zhttp_request_send (request, self, /*timeout*/ 10000, /* user args*/ NULL, NULL);
assert (rc == 0);
void *user_arg;
void *user_arg2;
zhttp_response_t* response = zhttp_response_new ();
rc = zhttp_response_recv (response, self, &user_arg, &user_arg2);
assert (rc == 0);
assert (streq (zhttp_response_content (response), "Hello World!"));
zhttp_client_destroy (&self);
zhttp_request_destroy (&request);
zhttp_response_destroy (&response);
like okay look at her π β make a client, make a request, set the url, set the method to "GET", send it with a /*timeout*/ 10000 and /* user args*/ NULL, NULL, assert (rc == 0), then make a response, recv into &user_arg and &user_arg2, assert (rc == 0), and check that streq (zhttp_response_content (response), "Hello World!"). and then everyone gets destroyed at the end because we're responsible queens. π
πΈ AUTHORS πΈ
the czmq manual was written by the authors in the AUTHORS file. periodt.
π RESOURCES π
- Main web site:
- Report bugs to the email
<zeromq-dev@lists.zeromq.org[1]>
π§ yes, "Main web site:" really is just sitting there like that in the original. i'm not adding a link, i'm not taking one away. we respect the source in this house.
π COPYRIGHT π
Copyright (c) the Contributors as noted in the AUTHORS file. This file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org. This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. LICENSE included with the czmq distribution.
β NOTES β
zeromq-dev@lists.zeromq.orgmailto:zeromq-dev@lists.zeromq.org
and that's the whole page bestie π«Ά β this was CZMQ 4.2.1, dated 01/16/2026, and that's the ZHTTP_CLIENT(3) footer energy signing off. go forth and http, carefully, because it's still a draft. mwah. π
π¦ where this page comes from
- fedora 44: czmq-devel 4.2.1-24.fc44 Β· MPL-2.0
- fedora 44: czmq-devel 4.2.1-24.fc44 Β· MPL-2.0
- ubuntu resolute: libczmq-dev 4.2.1-3build1 Β· MPL-2.0
- ubuntu stonking: libczmq-dev 4.2.1-3build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms