codethrasher

Curl a GraphQL API

1
2
3
4
5
6
7
curl -0 -v -X POST https://some.api.com/graphql \
-H 'Content-Type: application/json' \
-d @- << EOF
{
  "query": "query { someQuery (someArg: false) { name } }"
}
EOF

curl will probably complain about the -X POST being inferred, but it shouldn’t harm anything. It can be left out.

← Function Overloading Org-mode cheatsheet →