How to use curl to access the github graphql API

You just need to escape the double quotes that are inside the JSON as the query $ curl -i -H ‘Content-Type: application/json’ -H “Authorization: bearer myGithubAccessToken” -X POST -d ‘{“query”: “query {repository(owner: \”wso2\”, name: \”product-is\”) {description}}”}’ https://api.github.com/graphql

How can I run multiple curl requests processed sequentially?

It would most likely process them sequentially (why not just test it). But you can also do this: make a file called curlrequests.sh put it in a file like thus: curl http://example.com/?update_=1 curl http://example.com/?update_=3 curl http://example.com/?update_=234 curl http://example.com/?update_=65 save the file and make it executable with chmod: chmod +x curlrequests.sh run your file: ./curlrequests.sh or …

Read more

What is -u flag on cURL actually doing?

curl -u encodes the username:password string into a base-64 string which is passed in the Authorization header, like so: GET / HTTP/1.1 Host: example.com Accept: text/html Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ= This isn’t easy to skim, but it’s not encryption either. Anyone with a base 64 decoder can see the username and password, so make sure you …

Read more

cURL -d . parameter

Whenever your have a doubt use man. Issue man curl and read about -d switch. -d, –data <data> (HTTP) Sends the specified data in a POST request to the HTTP cause curl to pass the data to the server using the content-type -d, –data is the same as –data-ascii. –data-raw is almost the ter. To …

Read more