Comments (10)
Really?
Who would not install httpie for their training environment? And why is "curl" better?
from varnish-book.
I love httpie, and would definitely encourage anybody to install it - both in training and production environments.
But certainly if the customer has a strict policy on their testing machines, and for example deploy standard server VMs to do the training on, it can certainly be a problem. But if it's packaged in EPEL (which I think it is? Thoug not sure?), I'm not sure if it's a bigger problem than installing Varnish itself?
from varnish-book.
The training requires local root.
If they can't install httpie in their training environment they figure out how to use curl on their own.
There is absolutely no need to suboptimize the book just because someone has a lame security policy.
from varnish-book.
I think a reasonable compromise would perhaps be to use httpie in the examples and such, but then include a small section of "here's how you do the most common things in curl as well" - for those that are stuck with it. But using httpie "inline".
from varnish-book.
We leave httpie in.
If somebody cares enough about this to contribute a little appendix on curl usage I'm sure pull requests would be pulled with a smile and a nice pat on the back. :-)
from varnish-book.
I'll wait until Dridi is back from vacation to comment on this issue. It is my understanding that he faced many problems with httpie while teaching at a customer's site.
from varnish-book.
In the Varnish 3 series of the Varnish Book, I used to get negative feedback on the GET
command, because unlike curl
they couldn't figure what the flags would mean.
For my first Varnish 4 training, the customer had decided to host the VMs used for training, and they use RHEL 6. Httpie couldn't be installed via EPEL and they eventually tried with pip
but in the end it didn't work.
Fallback to curl, but looking at http
commands they did not understand what was going on, especially the developers (it was a 3 days training including both courses). And there's a terrible UI decision in httpie that leads to confusion.
http -p hH --proxy=http:http://localhost sport.example.com/index.html
The --proxy
option is confusion because:
- of the http:http: double scheme
- the very name "proxy"
- the impedance mismatch with HTTP
They first thought that they had to specify this to bypass their corporate proxy. Then they thought that doubling http:
was a typo. And then they didn't understand the relationship between this and a Host:
header.
If we keep httpie, we should for instance get rid of all --proxy
options and simply follow the principle of lest astonishment.
http -p hH localhost/index.html Host:sport.example.com
Same result, a lot closer to reality. That is important during training to not confuse trainees, they already have a hard time with VCL.
Now why curl
?
It doesn't pretty print the output, it doesn't have colors. But really when a trainee is on a windows laptop using putty, they have bad UX anyway. And it's not that hard to read one key:value per line.
It is more verbose:
http -p hH localhost/index.html Host:sport.example.com
# vs
curl --verbose --header Host:sport.example.com localhost/index.html
# vs
curl -v -H Host:sport.example.com localhost/index.html
And you don't get to pick what's printed, that one thing httpie does way better. But during the training, you only access to small files so it doesn't really hurt. Only the chapters HTTP and Content Composition contain large (for a terminal) files, but you look at them through a browser, and we use the developer tools to look at the HTTP bits.
And the main reason for using curl
is not that I'm used to it and sysadmins are usually too as described above. The main reason is stability and consistency. Curl is mature, and available on all the platforms we support. Differences in feature (if any) between one shipped in RHEL 5 or 7 doesn't change anything for the training and is thus reliable.
We want to waste the least possible time and neurons during a training, because Varnish is disruptive, and therefore we need the most stable and comfortable environment possible.
My $0.02
from varnish-book.
Those are valid objections. Probably worth a tad bit more than
I'll see if I can find the time to rewrite some of the httpie statements to be more in line with best practices. The use of --proxy is probably a bit distracting and should be placed.
I suggest we move along with the current toolset and at a later point, when we're happy with the rest of the content we can add curl examples alongside the httpie ones. As you say, curl is omnipresent and a well known tool. However, my personal option is that httpie is a lot more powerful (the native JSON support is very nice).
You might scoff at the color support in httpie, but for me it makes a bit of a difference. I've abandoned curl quite a bit of time ago.
from varnish-book.
@perbu I use httpie when I want to look at the payload itself, because color support becomes very useful there!
I still use curl for both interactive commands and scripting, so unless I'm interested in looking at the response body, I stick to it.
During the training, we rarely look at the body, and AFAIK there's no json involved. When we do care about the body, we use a proper browser.
from varnish-book.
Closed because this issue is a bit subjective and we better use our resources in more meaningful improvements for the book.
from varnish-book.
Related Issues (20)
- Exercise 5.10 lacking instructions HOT 2
- Make "Configure Varnish" an exercise HOT 2
- Compression chapter lacking important information HOT 1
- Solution references HOT 6
- VCL variable table out of sync with text HOT 1
- systemd instructions for debian/ubuntu HOT 5
- Add `saint mode` HOT 1
- Inaccurate chapter title: VCL Built-in Subroutines HOT 4
- No more bereq obj in sub vcl_miss or vcl_pass HOT 1
- The version and copyright info links to a 404 page. HOT 1
- Title page has no following blank page HOT 9
- Confusion regarding gzip and Vary? HOT 1
- Add shard directors HOT 2
- Possible improvement for exercise 9.5 HOT 2
- Varnish Tuner needs to be removed HOT 1
- varnish_book.rst refers to repo.varnish-cache.org
- Add a deprecation overlay that has a call-to-action button to our new book
- Add hitch to section 12.4 HOT 1
- Exercise "Filter Varnish Log Records" to use 404 HOT 3
- Notable counters don't include hits/misses HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from varnish-book.