4 ms·
A curl cheat sheet
- javajosh 11y agoMay I suggest adding `--proxy URL` which is useful if using Charles/Fiddler to toggle between environments.
- wldcordeiro 11y agoWhile great, I stopped using it for httpie instead, it has a much simpler interface.
- sudo_bang_bang 11y agoLikewise, I switched over. I just wish HTTPie could have an "output to curl" feature.
- dfc 11y agoI apologize if this is obvious but I do not understand why you wish httpie had an output to curl feature? Am I missing some sarcastic twist?
- trashcan 11y agoI think they meant that it would useful to have it provide a curl equivalent command, much like chrome has in the network section.
- lkey 11y agoI'd guess it has something to do with curl being available everywhere and httpie requiring installation. Oftentimes you can't enforce that your preferred alternative is deployed where you'd like to run scripts, so http->curl.
- sohkamyung 11y agoMaybe I'm wrong, but httpie appears to be targetting http transactions only, while curl supports multiple protocols (ftp, etc.). curl's syntax is also baked into various Web Browser network debuggers. Both Chrome and Firefox's network transactions display have a "output to curl" option to allow you to recreate the network transaction exactly. Edit: on Firefox, the option is "Copy as curl"
- wldcordeiro 11y agoThat is true, curl has some additional protocol features and then of course it being a standard part of most *nix OSes makes it easy to understand why Chrome and Firefox both have the copy as curl option. I still use curl regularly but for any pure http(s) stuff I use httpie because of its improved user experience.
- coderholic 11y agoNot strictly a curl hack, but you can quickly get your IP geolocation details with curl and http://ipinfo.io http://ipinfo.io (full disclosure, it's my service): $ curl ipinfo.io { "ip": "208.54.39.206", "hostname": "mce2736d0.tmodns.net", "city": "Los Angeles", "region": "California", "country": "US", "loc": "34.0522,-118.2437", "org": "AS21928 T-Mobile USA, Inc.", "postal": "90013", "phone": 213 } Or just your IP $ curl ipinfo.io/ip 208.54.39.206 Or any other field (eg. city) $ curl ipinfo.io/city Los Angeles Or lookup another IP $ curl ipinfo.io/8.8.8.8 { "ip": "8.8.8.8", "hostname": "google-public-dns-a.google.com", "city": "Mountain View", "region": "California", "country": "US", "loc": "37.3860,-122.0838", "org": "AS15169 Google Inc.", "postal": "94040", "phone": 650 } Or a specific field for that IP: $ curl ipinfo.io/8.8.8.8/org AS15169 Google Inc.
- dfc 11y agoIf you start a comment out with "not strictly [related to linked article]" and hijack the discussion by plugging a website it seems like the decent thing to do is mention that you are the developer behind said website. I think this is even more important when you include so much <pre> text that the other comments are pushed so far down the page. Full-Disclosure: Some people still believe in it
- coderholic 11y agoThanks for the tip. I've updated the comment to add the disclosure. Definitely not my intention to hide it though, it's clearly listed in my profile.
- sigma2015 11y ago> the decent thing to do is mention that you are the developer behind said website or just use a fake account ... like anybody else :D
- krat0sprakhar 11y agoI can't probably count how many times I use this in a week. Thank you very much for this service :)
- trashcan 11y agoSlightly offtopic, but I highly recommend using httpie for command line http: https://github.com/jkbrzt/httpie https://github.com/jkbrzt/httpie No cheatsheeet needed, the syntax is a lot friendler.
- nulltype 11y agohttpie is the last curl cheatsheet you'll ever need
- glynjackson 11y agoFound httpie sometime back. I still use curl but 80% of the time I use httpie now.
- est 11y agocurl -e "referer"
- baldfat 11y agoConfessions. I know I should use curl but I never do and just use wget and think curl is just a one year newer wget :( curl is better tool than wget but I used wget first and never changed. I do use aria2c more now for downloading but I know curl is a great tool I don't use.