Answers for "curl post api sample"

29

curl post json

curl -X POST -H "Content-Type: application/json" 
 -d '{"username":"abc","password":"abc"}' 
 https://api.example.com/v2/login
Posted by: Guest on July-03-2020
2

curl post

# dont forget the content type, else it will throw an error

curl -X POST -H "Content-Type: application/json" 
 -d '{"username":"abc","password":"abc"}' 
 https://api.example.com/v2/login
Posted by: Guest on August-12-2021
5

curl get example

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/resource
Posted by: Guest on July-01-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language