Skip to content

Wrapping the Asio library to create a simple HTTP client that supports connecting via domain names and IP addresses.

License

Notifications You must be signed in to change notification settings

samxfb/cpp-httpclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-httpclient

Wrapping the Asio library to create a simple HTTP client that supports connecting via domain names and IP addresses.

Mac and Linux is supported

asio模块加载

git submodule update --init --recursive

编译

./build.sh

运行

Usage:
./cpp-httpclient [ip] [port] [method:GET/POST...] [url/path]
./cpp-httpclient --host [host] [method:GET/POST...] [url/path]

测试

借助在线服务(https://httpbin.org/

./cpp-httpclient --host httpbin.org GET /get

connect httpbin.org [ip 184.73.216.86, port 80]

RESULT: HTTP/1.1 200  OK
response message:
{
  "args": {}, 
  "headers": {
    "Accept": "*/*", 
    "Host": "httpbin.org", 
    "X-Amzn-Trace-Id": "Root=1-65ab4f91-7370ba8a2d5dee213fb955d6"
  }, 
  "origin": "218.108.104.131", 
  "url": "http://httpbin.org/get"
}

About

Wrapping the Asio library to create a simple HTTP client that supports connecting via domain names and IP addresses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published