Add shortcuts for GET, POST, etc. to HttpClientSession.

This commit is contained in:
Chunting Gu
2019-03-22 16:11:01 +08:00
parent 52231d52e6
commit 3b7f4ecacf
14 changed files with 198 additions and 115 deletions
+2 -4
View File
@@ -25,8 +25,7 @@ int main() {
try {
webcc::HttpClientSession session;
auto r = session.Request(webcc::HttpRequestBuilder{}.Get().
url("http://httpbin.org/get")());
auto r = session.Get("http://httpbin.org/get");
std::cout << r->content() << std::endl;
@@ -40,8 +39,7 @@ int main() {
List GitHub public events:
```cpp
auto r = session.Request(webcc::HttpRequestBuilder{}.Get().
url("https://api.github.com/events")());
auto r = session.Get("https://api.github.com/events");
// Parse r->content() to JSON object...
```