0
I would like to reduce the keystrokes when I use curl to test web services on my workstation.
Is there a way to set a default hostname of 'localhost:3000' into ~/.curlrc so the following will work?
curl /foo.json
0
I would like to reduce the keystrokes when I use curl to test web services on my workstation.
Is there a way to set a default hostname of 'localhost:3000' into ~/.curlrc so the following will work?
curl /foo.json
1
On Unix – shell functions:
cu() { curl "http://localhost:3000/$1"; }
cu foo.json
would be translated to curl http://localhost:3000/foo.json
.
Downside: needs far more code to support options (curl -I
and stuff), but that can be achieved too.