curl commands explained code example

Example 1: curl example

curl --request POST \
  --url https://api.sendgrid.com/v3/mail/send \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"personalizations": [{"to": [{"email": "[email protected]"}]}],"from": {"email": "[email protected]"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Heya!"}]}'

Example 2: curl command

#usage:
curl 
#it returns the raw text of the page (or anything else) at  in the internet
#to stdout
#examples:
#put the output into 
curl  > 
#to search for 
curl  | grep //
#to uncompress the output
curl  | gunzip

#you get the hang of it.

#helpful if you are testing a server :)
#be sure to be on bash or powershell!

Example 3: curl command

curl --header "Authorization: key=AAAAbh_xxx-nI:APBAwd91bGn1OssamQlG4R1v84yXOv-6oynz1i4eNltzQLd5ojIiFSHvnCFHJyA33QcRfeAMa5As2mjfEjkRA_XA-YM8gsqEQssm3Ykrn8FSBEwwwkot5KPWY0zMefYB1RZj1ZlZfsWy" --header "Content-Type: application/json" -d '{"to": "f8UQCp0VHqCrBR0Yeiwx0:APA91bHuqLN7Wp40U2Wt8LS3VcRipttiViYF4TXHKP1Rusdov542XEgUYaVk9GIAEM3Q2kHcME5D85BsyWg7vk3H3oLhKJdNQLSNyoxzfnhGAvuQo4BiTZ43sIdVGQ7t86WQDn6s9HBj", "data": {"status": "New information!!!"}}' https://fcm.googleapis.com/fcm/send

Tags:

Misc Example