add Accept() for Accept header to request builder
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user