idealvin / gitalk

comments for Alvin's blog
0 stars 0 forks source link

HTTP | Documents for Coost #109

Open idealvin opened 1 year ago

idealvin commented 1 year ago

https://coostdocs.github.io/en/co/net/http/

include: co/http.h.

http::Client http::Client is a coroutine-based HTTP client, which is implemented based on libcurl.

Client::Client explicit Client(const char serv_url); Constructor, the parameter serv_url is the url address of the server, and its form is protocol://host:port, the following server urls are all ok: “github.com” “https://github.com” “http://127.0.0.1:7788” “http://[::1]:8888” Connection is not established in the constructor. #Client::~Client Client::~Client(); Destructor, close the connection, and release libcurl related resources. #Client::add_header void add_header(const char key, const char val); void add_header(const char key, int val); Add a HTTP header.