Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
chenxuan520
cppnet
Repository navigation
Code
Issues
1
(1)
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
http_client
Jump to bottom
github-actions edited this page
Nov 21, 2024
·
1 revision
cppnet::HttpClient
HttpClient()
参数:无
返回值:无
作用:构造一个 HttpClient 对象。
~HttpClient()
参数:无
返回值:无
作用:HttpClient 类的析构函数,用于关闭客户端连接。
int Init(Address &addr)
参数:
addr
:服务器地址对象。
返回值:
int
类型,0 表示成功,-1 表示失败。
作用:初始化客户端,连接到指定的服务器地址。
int Send(HttpReq &req, HttpResp &resp)
参数:
req
:Http 请求对象的引用。
resp
:Http 响应对象的引用。
返回值:
int
类型,0 表示成功,-1 表示失败。
作用:发送 Http 请求并接收 Http 响应。
void Close()
参数:无
返回值:无
作用:关闭客户端连接。
int InitSSL(Address &addr)
参数:
addr
:服务器地址对象。
返回值:
int
类型,0 表示成功,-1 表示失败。
作用:初始化 SSL 客户端,连接到指定的服务器地址。
Socket &socket()
参数:无
返回值:
Socket &
,套接字对象的引用。
作用:获取客户端的套接字对象。
std::string err_msg()
参数:无
返回值:
std::string
类型,错误消息。
作用:获取错误消息。
Wiki pages
Pages
24
Loading
Home
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
address
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
date
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
file
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
host
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_client
cppnet::HttpClient
HttpClient()
~HttpClient()
int Init(Address &addr)
int Send(HttpReq &req, HttpResp &resp)
void Close()
int InitSSL(Address &addr)
Socket &socket()
std::string err_msg()
Loading
http_filter
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_header
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_method
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_req
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_resp
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_route
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_server
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_status_code
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
http_version
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
io_multiplexing_base
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
logger
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
README.en
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
socket
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
ssl_context
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
ssl_socket
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
string
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
tcp_server
Uh oh!
There was an error while loading.
Please reload this page
.
Loading
version
Uh oh!
There was an error while loading.
Please reload this page
.
Show 9 more pages…
Clone this wiki locally
You can’t perform that action at this time.