DEV Community

Cover image for CURL SERIES :The Curl command
Bhupesh Chandra Joshi
Bhupesh Chandra Joshi

Posted on

CURL SERIES :The Curl command

Do you want to check the health of your application, how server is working behind the scene type the command.

curl -I url

It will present the health of your website. for example we have taken example of chatgpt.

curl -I https://chatgpt.com

curl -X POST http://localhost:3000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "Test@123",
"fullName": "Test User"
}'

The purpose of curl : It allow us to make request to a website/ api or server from the terminal.

-X flag describes the which method you will use. POST means you are creating the resource and -H flag indicates the header of your request.

-d indicates the payload the actual data of your project.

Test User Login:

curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "Test@123"
}'

chaicode #curl

Top comments (0)