3 ms·
> You just can't perform network I/O synchronously. Sure you can, you just shouldn't ever do it because it blocks the UI: https://developer.mozilla.org/en-US/
by Izkata 2y ago
> You just can't perform network I/O synchronously.
Sure you can, you just shouldn't ever do it because it blocks the UI: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest_API/Synchronous_and_Asynchronous_Requests#synchronous_request https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequ...
- throwitaway1123 2y agoYeah I should've said there's no Node API for making synchronous HTTP requests (unless you count executing a child process synchronously). Even the older http.request API used in Node prior to the introduction of fetch is async and accepted a callback. Browsers have all sorts of deprecated foot guns though (like the synchronous mode of XMLHttpRequest).