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 (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 ⭐

  1. zeromq-dev@lists.zeromq.org mailto: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