Skip to content

Instantly share code, notes, and snippets.

@ZaninAndrea
Created April 4, 2022 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZaninAndrea/6fb72fb4031bb8ff488a4601e2448295 to your computer and use it in GitHub Desktop.
Save ZaninAndrea/6fb72fb4031bb8ff488a4601e2448295 to your computer and use it in GitHub Desktop.
Step 1 - Igloo with C++ tutorial
#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