#mightymonsterwheelies #persona #soccerball #actinglikeadog #fetch
Our cat thinks she's a dog

[Перевод] Выполнение HTTP-запросов в Node.js
Долгое время я использовал пакет request (теперь устаревший) для выполнения HTTP-запросов в Node.js. Затем в моду вошли промисы (promises), и я переключился на request-promise (также ныне устаревший). Затем я начал использовать axios и думал, что на этом все... но ошибался. История HTTP в Node.js продолжает эволюционировать, и это прекрасно. Выполнение запросов HTTP - одна из самых распространенных задач в Node.js. Будь то обращение к API, получение данных из внешнего сервиса или разработка веб-скрейпера (scraper), важно знать, как делать это эффективно. Хорошая новость состоит в том, что начиная с Node.js 18 в качестве глобальной переменной доступен стандартный fetch() . Если вы использовали fetch() в браузере, то уже знаете, как использовать его на сервере. Никаких дополнительных зависимостей, никаких оберток, только тот же знакомый API, предоставляющий все необходимое для выполнения запросов HTTP современным способом в Node.js.
https://habr.com/ru/articles/1003750/
#nodejs #nodejs #javascript #js #fetch #http #https #undici #request #запрос
I've read the article with keen interest. Keep up the great work on curl @bagder
#curl #get #programming #technology #fetch #networking #https #http #ftp #OpenSource #POSIX #BSD #freeBSD #ghostBSD #openBSD #Linux #win64 #mac
🦋💙❤️💋#Lobi 💙💕🌹💐💙🦋
My interaction with the wonderful program curl is typical of my interaction with all Open Source programs which I use.
curl --helpman curlA swiss army knife for downloading has extensive manpages
man libcurl(3) {in MX Linux}man libcurlI know the basics of curl for my own use
Z
#curl #get #programming #technology #fetch #networking #https #http #ftp #OpenSource #POSIX #BSD #freeBSD #ghostBSD #openBSD #Linux #win64 #mac
curl libcurl
Just in case you have forgotten how to curl a file from a server here's a extensive howto
-L redirect
https://everything.curl.dev/http/browserlike.html?highlight=-L#redirects
-o filename
https://everything.curl.dev/usingcurl/downloads/url-named.html#download-to-a-file-named-by-the-url
-C - resume
https://everything.curl.dev/usingcurl/downloads/resume.html#resuming-and-ranges
curl --verbose -C - -L -o lp_someband_some_name_disc1side2.flac archive.org/download/lp_someband_somename-v/disc1/lp_someband_somename_disc1side2.flac
#curl #get #programming #fetch #networking #https #http #ftp #technology #OpenSource #POSIX #BSD #freeBSD #ghostBSD #openBSD #Linux #win64 #mac
curl libcurl
Just in case you have forgotten how to curl a file from a server here's a extensive howto with screenshots
`-L` redirect
https://everything.curl.dev/http/browserlike.html?highlight=-L#redirects
`-o` filename
https://everything.curl.dev/usingcurl/downloads/url-named.html#download-to-a-file-named-by-the-url
`-C -` resume
https://everything.curl.dev/usingcurl/downloads/resume.html#resuming-and-ranges
`curl --verbose -C - -L -o lp_someband_some_name_disc1side2.flac archive.org/download/lp_someband_somename-v/disc1/lp_someband_somename_disc1side2.flac`
#curl #get #programming #technology #fetch #networking #https #http #ftp #OpenSource #POSIX #BSD #freeBSD #ghostBSD #openBSD #Linux #win64 #mac
How to Stop fetch From Hanging Forever
fetch has no timeout by default.

Ooooh, fcuk, it is even worse. I do a JavaScript fetch request. Internally it notices that it needs to do its CORS OPTIONS magic first. That one fails with a 404, as the developer tools show. But the fetch request itself fails. No, it does not come back with a 404 response. It just fails the fetch with
TypeError: Failed to fetch
This even though the OPTIONS response says
Access-Control-Allow-Origin *
beside the 404. This is baaaad!