3 ms·
The best thing about curl is that developer tools of browsers (firefox for example) have a convenient "Copy as curl" feature that mimics the web request. The re
by msravi 4y ago
The best thing about curl is that developer tools of browsers (firefox for example) have a convenient "Copy as curl" feature that mimics the web request. The reason there isn't a "Copy as wget" option, I think, is the level of control that curl allows so the request can be tailored to exactly mimic the browser.
But when you want to recursively download a website, of course, nothing better than wget. curl doesn't support that, and you'll need to parse and fetch the urls recursively yourself with a script.
- amelius 4y agoCopying from the web and pasting in a terminal, is that not a bad practice from a security viewpoint?
- Lukas_Skywalker 4y agoThe command comes from a text field of the developer tools, which are provided by the browser vendor, not the websites. It allows you to repeat a request that the browser did, but in your own terminal. It only downloads data, but doesn‘t run downloaded scripts.
- amelius 4y agoOk, I misread that.
- verhovsky 4y agoYou can paste that curl command into https://curlconverter.com/wget/ https://curlconverter.com/wget/ to turn it into a Wget command. > The reason there isn't a "Copy as wget" option, I think, is the level of control that curl allows so the request can be tailored to exactly mimic the browser. That's not true. You can read the code that generates the curl command, it's pretty straightforward: https://github.com/ChromeDevTools/devtools-frontend/blob/c9afdb4745a76866f7486be0e5cdd4e2b270d8af/front_end/panels/network/NetworkLogView.ts#L2033 https://github.com/ChromeDevTools/devtools-frontend/blob/c9a... The arguments it uses are --url, --data-raw, -X/--request, -H/--header, --compressed and --insecure, all of which Wget has an analog of. I think the reason is that they don't care to do it and/or they don't want to make that "Copy" dropdown too long.