News for hackers. Stuff that matters.
Re:Modern Node.js Patterns by pbreit on Sunday August 03, 2025 @05:49PM (#44780134)
It has always astonished me that platforms did not have first class, native "http client" support. Pretty much every project in the past 20 years has needed such a thing.

Also, "fetch" is lousy naming considering most API calls are POST.

Re:Modern Node.js Patterns by catlifeonmars on Sunday August 03, 2025 @07:41PM (#44780792)
“Most” is doing a lot of heavy lifting here. I use plenty of APIs that are GET
Re:Modern Node.js Patterns by pbreit on Monday August 04, 2025 @02:44PM (#44789862)
I was thinking server-side where it's probably 90%+ POST. True, client-side a lot different (node the only player client-side, though).
Re:Modern Node.js Patterns by rendall on Sunday August 03, 2025 @07:28PM (#44780715)
That's a category error. Fetch is just refers to making a request. POST is the method or the HTTP verb used when making the request. If you're really keen, you could roll your own

  const post = (url) => fetch(url, {method:"POST"})
Re:Modern Node.js Patterns by catlifeonmars on Sunday August 03, 2025 @07:44PM (#44780808)
I read this as OP commenting on the double meaning of the category. In English, “fetch” is a synonym of “GET”, so it’s silly that “fetch” as a category is independent of the HTTP method
Re:Modern Node.js Patterns by rendall on Sunday August 03, 2025 @10:04PM (#44781491)
That makes sense.
Re:Modern Node.js Patterns by tracker1 on Monday August 04, 2025 @12:43PM (#44788283)
Node was created with first-class native http server and client support. Wrapper libraries can smooth out some rough edges with the underlying api as well as make server-side js (Node) look/work similar to client-side js (Browser).