{
"name":Himalay Sunuwar,
"bio":I'm a programmer from Himalayas, I listen to Metal and eat Rice. No I don't smoke, drink, or do drugs.,

Post JSON data using cURL command

Himalay Sunuwar
Himalay Sunuwar
July 23rd, 2016 · 1 min read

In this post I would like to show how to make post request with JSON data using curl cli tool.

Inline JSON

1curl -X POST \
2-H "Content-Type: application/json" \
3-H "Accept: application/json" \
4-d '{"username":"xyz","password":"xyz"}' \
5https://httpstat.us/200

JSON file

1curl -X POST \
2-H "Content-Type: application/json" \
3-H "Accept: application/json" \
4-d @auth.json \
5https://httpstat.us/200
5

More articles

Automate NumLock toggle on external keyboard in Linux

We can use the Udev events when an external keyboard is plugged-in or unplugged to toggle the NumLock automatically.

May 28th, 2020 · 1 min read

Keeping code snippets handy in Chrome DevTool

We can save any piece of JavaScript as Snippet in Chrome DevTool and we can run it on DevTool console any time we need.

November 8th, 2017 · 1 min read
"social":
{
"github":@himalay,
"linkedin":@sunuwar,
"twitter":@HimalaySunuwar,
"instagram":@HimalaySunuwar,
},
"sitemap":/sitemap.xml,
"rss":/rss.xml
}