DEV Community

Cover image for Curl Command for Developer
Ar-ruk Kachen
Ar-ruk Kachen

Posted on

2 1

Curl Command for Developer

This cheatsheet was collected famous CURL command for Software Developer. Exactly it's easy for checking and testing communicate between frontend and backend

if you want to see more information or option. Please see in : Curl man page

1.Request with set value specific header

curl --header "X-MyHeader: 123" URL
Enter fullscreen mode Exit fullscreen mode

2.Request with using cookie

curl -v --cookie "COOKIEKEY=VALUE" URL
Enter fullscreen mode Exit fullscreen mode

3.Request with method and body

curl -X HTTPMETHOD -H "Content-Type: application/json" -d '{"key1":"value"}' URL

Enter fullscreen mode Exit fullscreen mode

4.Request with Form-data

curl -X POST -H "Content-Type: multipart/form-data;" -F "key1=val1" URL

Enter fullscreen mode Exit fullscreen mode

5.Request with Post File

curl -X POST -F 'file=@/file-path.csv' URL

Enter fullscreen mode Exit fullscreen mode

6.Get HTTP Status Only

curl -s -o /dev/null -w "%{http_code}" URL

Enter fullscreen mode Exit fullscreen mode

7.Get Response Header only

curl -I https://www.google.com

Enter fullscreen mode Exit fullscreen mode

8.Get Response value of specific header

(Example: for get content-type header)

curl -sI URL | tr -d '\r' | sed -En 's/^<u>content-type</u>: (.*)/\1/p'

Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more