Created
April 4, 2022 14:45
-
-
Save ZaninAndrea/6fb72fb4031bb8ff488a4601e2448295 to your computer and use it in GitHub Desktop.
Step 1 - Igloo with C++ tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cpr/cpr.h> | |
int main(int argc, char** argv) { | |
std::string query = "{ user { email } }"; | |
std::string token = "replace-your-access-token-here"; | |
cpr::Response r = cpr::Post(cpr::Url{"https://v1.igloo.ooo/graphql"}, | |
cpr::Body{"{\"query\": \"" + query + "\"}"}, | |
cpr::Header{ | |
{"Content-Type", "application/json"}, | |
{"Authorization", "Bearer "+ token} | |
}); | |
std::cout << r.text << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment