TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Mastering curl: interactive text guide

112 pointsby asicspover 1 year ago

6 comments

Karellenover 1 year ago
&gt; Curl automatically expands glob expressions in URLs into multiple specific URLs.<p>&gt; For example, this command requests three different paths (al, bt, gm), each with two different parameters (num=1 and num=2), for a total of six URLs:<p><pre><code> curl --output-dir &#x2F;tmp -o &quot;out_#1_#2.txt&quot; http:&#x2F;&#x2F;httpbin&#x2F;anything&#x2F;{al,bt,gm}?num=[1-2] </code></pre> Note that it&#x27;s not just curl that does glob expansion. So do some shells. Try:<p><pre><code> echo http:&#x2F;&#x2F;httpbin&#x2F;anything&#x2F;{al,bt,gm}?num=[1-2] </code></pre> Bash does &quot;brace expansion&quot; on `{al,bt,gm}` to create 3 separate params before they are given to curl&#x2F;echo. (Although other, stricter bourne shells, like `dash`, do not perform this expansion.)
bloopernovaover 1 year ago
In the linked article, all the examples use a hostname of &quot;httpbin&quot;. To run the examples locally, I had to replace that with httpbin.org.<p>Is that a standard test host? I&#x27;m curious about why it&#x27;s named httpbin - is it a docker hostname?<p>Sorry for a weird offtopic question :&#x2F;
评论 #37392702 未加载
评论 #37392640 未加载
scientaster2over 1 year ago
Shameless plug for a load testing tool I built that, in my workflow, relies on curl for the request syntax: <a href="https:&#x2F;&#x2F;github.com&#x2F;Steven-Ireland&#x2F;spam">https:&#x2F;&#x2F;github.com&#x2F;Steven-Ireland&#x2F;spam</a>
malablasterover 1 year ago
I love cURL and have been using it for development, POCs, and documentation for years. I’m curious though… are people using it in production much?
评论 #37395142 未加载
评论 #37393437 未加载
评论 #37403772 未加载
评论 #37412203 未加载
评论 #37396813 未加载
H4K3Rover 1 year ago
I was looking for a guide, thanks!
snthpyover 1 year ago
Do we need to still learn this or can we all just switch to httpie or resti.sh given that it&#x27;s 2023?