Rename Request() to Send().
This commit is contained in:
+12
-17
@@ -55,9 +55,8 @@ void PrettyPrintJsonString(const std::string& str) {
|
||||
// List public events.
|
||||
void ListEvents(webcc::ClientSession& session) {
|
||||
try {
|
||||
auto r = session.Request(webcc::RequestBuilder{}.
|
||||
Get(kUrlRoot).Path("events")
|
||||
());
|
||||
auto r = session.Send(webcc::RequestBuilder{}.Get(kUrlRoot).Path("events")
|
||||
());
|
||||
|
||||
PRINT_JSON_STRING(r->data());
|
||||
|
||||
@@ -71,10 +70,9 @@ void ListEvents(webcc::ClientSession& session) {
|
||||
// ListUserFollowers(session, "<user>")
|
||||
void ListUserFollowers(webcc::ClientSession& session, const std::string& user) {
|
||||
try {
|
||||
auto r = session.Request(webcc::RequestBuilder{}.
|
||||
Get(kUrlRoot).Path("users").Path(user).
|
||||
Path("followers")
|
||||
());
|
||||
auto r = session.Send(webcc::RequestBuilder{}.Get(kUrlRoot).
|
||||
Path("users").Path(user).Path("followers")
|
||||
());
|
||||
|
||||
PRINT_JSON_STRING(r->data());
|
||||
|
||||
@@ -90,10 +88,9 @@ void ListAuthUserFollowers(webcc::ClientSession& session,
|
||||
const std::string& login,
|
||||
const std::string& password) {
|
||||
try {
|
||||
auto r = session.Request(webcc::RequestBuilder{}.
|
||||
Get(kUrlRoot).Path("user/followers").
|
||||
AuthBasic(login, password)
|
||||
());
|
||||
auto r = session.Send(webcc::RequestBuilder{}.Get(kUrlRoot).
|
||||
Path("user/followers").AuthBasic(login, password)
|
||||
());
|
||||
|
||||
PRINT_JSON_STRING(r->data());
|
||||
|
||||
@@ -112,12 +109,10 @@ void CreateAuthorization(webcc::ClientSession& session,
|
||||
" 'scopes': ['public_repo', 'repo', 'repo:status', 'user']\n"
|
||||
"}";
|
||||
|
||||
auto r = session.Request(webcc::RequestBuilder{}.
|
||||
Post(kUrlRoot).Path("authorizations").
|
||||
Body(std::move(data)).
|
||||
Json().Utf8().
|
||||
AuthBasic(login, password)
|
||||
());
|
||||
auto r = session.Send(webcc::RequestBuilder{}.Post(kUrlRoot).
|
||||
Path("authorizations").AuthBasic(login, password).
|
||||
Body(std::move(data)).Json().Utf8()
|
||||
());
|
||||
|
||||
std::cout << r->data() << std::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user