Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Sometimes the best answer is not the accepted one or the one with most votes. This one works cross platform as on macos you do not get the newest curl that has the --fail-with-body... same for lots of other platforms. Ugly, but works.