'\" t .\" Title: zhttp_client .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 03/02/2024 .\" Manual: CZMQ Manual .\" Source: CZMQ 4.2.1 .\" Language: English .\" .TH "ZHTTP_CLIENT" "3" "03/02/2024" "CZMQ 4\&.2\&.1" "CZMQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zhttp_client \- Class for provides a simple http client .SH "SYNOPSIS" .sp .nf // 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 Please add \*(Aq@interface\*(Aq section in \*(Aq\&./\&.\&./src/zhttp_client\&.c\*(Aq\&. .fi .SH "DESCRIPTION" .sp zhttp_client \- provides a simple http client .sp Please add \fI@discuss\fR section in \fI\&./\&.\&./src/zhttp_client\&.c\fR\&. .SH "EXAMPLE" .PP \fBFrom zhttp_client_test method\fR. .sp .if n \{\ .RS 4 .\} .nf 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); .fi .if n \{\ .RE .\} .sp .SH "AUTHORS" .sp The czmq manual was written by the authors in the AUTHORS file\&. .SH "RESOURCES" .sp Main web site: \m[blue]\fB\%\fR\m[] .sp Report bugs to the email <\m[blue]\fBzeromq\-dev@lists\&.zeromq\&.org\fR\m[]\&\s-2\u[1]\d\s+2> .SH "COPYRIGHT" .sp 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\&. .SH "NOTES" .IP " 1." 4 zeromq-dev@lists.zeromq.org .RS 4 \%mailto:zeromq-dev@lists.zeromq.org .RE