add Accept() for Accept header to request builder

This commit is contained in:
Chunting Gu
2020-08-10 09:48:30 +08:00
parent b334e359d7
commit 39ade6df4f
6 changed files with 42 additions and 14 deletions
+2 -2
View File
@@ -8,14 +8,14 @@ int main() {
WEBCC_LOG_INIT("", webcc::LOG_CONSOLE);
webcc::ClientSession session;
session.Accept("application/json");
webcc::ResponsePtr r;
try {
r = session.Send(webcc::RequestBuilder{}.
Get("http://httpbin.org/get").
Query("name", "Adam Gu", /*encode*/true).
Header("Accept", "application/json").Date()
Query("name", "Adam Gu", /*encode*/true).Date()
());
assert(r->status() == webcc::Status::kOK);