TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Uses for cURL

339 点作者 KrisJordan超过 12 年前

24 条评论

bentruyman超过 12 年前
I would strongly suggest HTTPie for the majority of these tasks: <a href="https://github.com/jkbr/httpie" rel="nofollow">https://github.com/jkbr/httpie</a>
评论 #4763283 未加载
评论 #4763057 未加载
评论 #4763236 未加载
评论 #4763895 未加载
评论 #4766456 未加载
k33l0r超过 12 年前
<i>&#62; If you only care about headers use the -I flag and the response body will be hidden</i><p>That is actually wrong. The -I flag set the request method to HEAD. So in some cases it will return different headers than a normal get request (and some servers don't implement HEAD responses at all).
评论 #4764014 未加载
评论 #4763013 未加载
评论 #4763018 未加载
yread超过 12 年前
If you're on windows and don't feel like using the commandline you can click around in Fiddler to achieve similar things. The help is much shorter <a href="http://www.fiddler2.com/fiddler/help/composer.asp" rel="nofollow">http://www.fiddler2.com/fiddler/help/composer.asp</a><p>I wasn't able to change the Host header successfully, though. A workaround is needed: <a href="https://groups.google.com/forum/?fromgroups=#!topic/httpfiddler/x8edRBYVhmE" rel="nofollow">https://groups.google.com/forum/?fromgroups=#!topic/httpfidd...</a>
评论 #4763812 未加载
laktek超过 12 年前
Nice. I like the way examples were constructed.<p>BTW, here are some more cURL tips I noted down a while back, which I found to be useful for daily work. - <a href="http://laktek.com/2012/03/12/curl-tips-for-daily-use/" rel="nofollow">http://laktek.com/2012/03/12/curl-tips-for-daily-use/</a>
swang超过 12 年前
The site does not work on the iPhone at all if you want to zoom in to read the text. If you start to touch and scroll the menu that was hidden away on the left decides to rear its ugly head and makes the site completely unreadable.<p>I'm pretty frustrated with sites that don't just have a basic two column layout. Is this a template theme? Otherwise why would you waste so much time on a left column that reflows and messes up the browser experience? Or better yet why not test this on an actual mobile browser?<p>I am not trying to harp on this site or the author specifically because there are certainly other offenders. This site though is quite annoying because once you finally think yougot that stupid menu out of the way, BOOM it pops right back an ruins the site again.<p>This is both a rant and a notice to the author since most people probably got too fed up to tell him about this problem.
评论 #4764155 未加载
cypherpunks01超过 12 年前
This title is a bit misleading. I was assuming that I'd be reading about how to use something that <i>wasn't</i> curl?
评论 #4763305 未加载
bryanlarsen超过 12 年前
I knew 8 of the 9, but the one I didn't (testing virtual hosts) was worth the cost of reading the entire article. Thanks.
评论 #4763464 未加载
评论 #4765633 未加载
eik3_de超过 12 年前
&#62; Test Virtual Hosts, Avoid DNS<p>&#62; With cURL just point the request at your host’s IP address<p>It's not even necessary to manually look up the IP, since options have precedence:<p><pre><code> curl server1.example.com -H Host:\ www.example.net </code></pre> looks up server1.example.com and connects to that IP with the given Host: Header. Just try the "-v" option to see what's going on.
antihero超过 12 年前
Fantastic, there's also a grand tool called httpie that's a bit nicer than curl <a href="https://github.com/jkbr/httpie" rel="nofollow">https://github.com/jkbr/httpie</a>
no_more_death超过 12 年前
I generally use wget myself. For basic HTTP debugging needs, I run ":%!wget -Sd <a href="http://www.example.com" rel="nofollow">http://www.example.com</a> inside a new vim buffer. Then I can read the Varnish headers or whatever and figure out what's going on.<p>I ran into an issue where the SSL implementation was a bit dated, though, and didn't recognize how a GoDaddy cert implemented multiple hostnames -- but it turned out to follow the standard. wget was just lacking in its implementation and reporting an error when the cert was fine.
RoryH超过 12 年前
Curl is great to have, but remembering all the options flags is a pain. Nowadays I use:<p>Chrome: "Postman" extension<p>Firefox: "REST Client" addon<p>...both great utilities for creating and saving any HTTP request you need.
评论 #4765638 未加载
tomchristie超过 12 年前
I'm sure there must be other sites documenting this too, but that's a very well written and prioritized bit of documentation - nicely done.<p>Your echo service is pretty nifty too.
评论 #4763341 未加载
randomfool超过 12 年前
Real HTTP from the command line is 'telnet localhost 80'.
评论 #4763580 未加载
评论 #4763582 未加载
scrrr超过 12 年前
This can be combined well with <a href="http://news.ycombinator.com/item?id=4762444" rel="nofollow">http://news.ycombinator.com/item?id=4762444</a> :)
agi超过 12 年前
Nice!!! Here is one more when it comes to working with the Internet Of Things: <a href="http://cosm.com/docs/quickstart/curl.html" rel="nofollow">http://cosm.com/docs/quickstart/curl.html</a> And using this I was inspired and managed to do this: <a href="http://www.agilart.com/blog/agilart-programs-using-cosm" rel="nofollow">http://www.agilart.com/blog/agilart-programs-using-cosm</a> #YAY
sravfeyn超过 12 年前
I never learnt cURL, or for that matter missed many of command-line tools because of the laziness to read boring long man pages. This is a perfect example of how a man page should be. All the options explained one by one with simple examples! It took me hardly 5 minutes, now I feel confident in using cURL for my next use.
goronbjorn超过 12 年前
This is a great resource. We use curl for sample API calls in our docs (developers.box.com/docs) because it's ubiquitous, but we've come to learn over time that knowledge of how to use curl is not ubiquitous.<p>Thanks for making this!
alpb超过 12 年前
I can add -I parameter to these. It sends a HEAD request, which only returns headers, works better when you don't need the response body as in -i.
nodesocket超过 12 年前
`curl --head <a href="http://google.com`" rel="nofollow">http://google.com`</a> is useful just to get the response headers back.
stephenhuey超过 12 年前
And if you prefer Ruby, try out htty: <a href="https://github.com/htty/htty" rel="nofollow">https://github.com/htty/htty</a>
评论 #4763608 未加载
boggzPit超过 12 年前
Does someone knows how to use Google Analytics API with cURL?<p>btw: nice overview!
hoka超过 12 年前
Helpful. I 'know' these, but this is a good cheat sheet to save around.<p>Really like the casual plug of your new project; I signed up :-)
drivebyacct2超过 12 年前
Why do people like cURL? I've regularly found it to have stupid defaults compared to wget. Is it because it's default on Mac and wget isn't?
评论 #4763845 未加载
评论 #4763747 未加载
caludio超过 12 年前
I hope tomorrow I'll see an even more useful article on sending email from the command line! Wow. /sarcasm
评论 #4768289 未加载
评论 #4763352 未加载