PMHTTPNEWCLIENT - Online Linux Manual PageSection : 3
Updated : PCP
Source : Performance Co-Pilot

NAMEpmhttpNewClient, pmhttpFreeClient, pmhttpClientFetch − simple HTTP client interfaces

C SYNOPSIS#include <pcp/pmapi.h>
#include <pcp/pmhttp.h> struct http_client *pmhttpNewClient(void);
void pmhttpFreeClient(struct http_client *client);
int pmhttpClientFetch(struct http_client *client, const char *url, char *bodybuf, size_t bodylen, char *typebuf, size_t typelen); cc ... −lpcp_web

DESCRIPTIONpmhttpNewClient allocates and initializes an opaque HTTP client that is ready to make requests from a server. The URL request interface pmhttpClientFetch issues an HTTP GET request to the server specified in the supplied url. The body of the response is returned in the caller supplied bodybuf buffer, of bodylen bytes length. An optional typebuf buffer, of typelen bytes length, can also be supplied and (if non-NULL) will contain the value of the content-type header returned from the server. The url parameter is an RFC1630 format URL. This will typically be prefixed with "http://", however these interfaces also support Unix domain sockets. Those are instead prefixed by "unix://", followed by the full filesystem path to the desired Unix domain socket. To free up resources associated with an HTTP client, including closing any persistent server connection that has been established earlier, is accomplished using the pmhttpFreeClient routine.

DIAGNOSTICSpmhttpNewClient will return NULL on failure, which can only occur when allocation of memory is not possible. pmhttpClientFetch will return the number of bytes places into the bodybuf buffer, else a negated error code indicating the nature of the failure.

SEE ALSOpmdaapache(1), pmjsonInit(3), PMAPI(3), PMWEBAPI(3) and https://tools.ietf.org/html/rfc1630.
0
Johanes Gumabo
Data Size   :   6,269 byte
man-p___mhttpClientFetch.3Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 225,919
Visitor ID   :     :  
Visitor IP   :   3.14.245.172   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.