Why an API answers curl but not a web page: CORS by example
Start with a request that works. You type https://api.example.com/items, leave the method on GET and press Send. Your browser sends the request with one extra header it adds by itself, Origin: https://yappykit.com, which names the page that asked. The server replies 200 with a JSON list and the header Access-Control-Allow-Origin: *. The star means any web page may read this reply, so the browser hands it to the page. You see the status, the time it took, the size, and the body indented for reading.
Now call a server that does not send that header. The request leaves your browser and reaches the server, and the server replies as usual. But the reply has no Access-Control-Allow-Origin, so the browser will not let this page read it. The page gets only a generic failure, the same one it would get for a wrong address or a server that is down. Browsers do this on purpose. If a page could tell those failures apart, it could map the machines on your local network. So the page says what is most likely and points you to the developer tools console, where the browser does name the reason.
Some requests are checked before they are sent. Suppose you send PUT https://api.example.com/items/7 with the headers Authorization: Bearer abc123 and Content-Type: application/json. A PUT, an Authorization header and a JSON content type each make the request one that needs permission first. The browser sends an OPTIONS request with Access-Control-Request-Method: PUT and Access-Control-Request-Headers: authorization,content-type. Only if the server replies with Access-Control-Allow-Methods and Access-Control-Allow-Headers that cover both does the browser send the real PUT. If the server does not, the PUT never leaves your device. A plain GET, or a POST with a form body, has no such check. It is sent, and only the reply is hidden. So a POST that this page reports as blocked may still have done its work on the server.
None of this applies outside a browser. curl, Python and Go do not send an Origin header and do not check Access-Control headers, so the same API that refuses this page answers them. That is why "it works in curl" is so often true and so little help. If an API you own blocks this page, the fix is on the server: return Access-Control-Allow-Origin for the origins you trust, and answer the OPTIONS preflight. If it is someone else's API, open the Request Code Generator, fill in the same request, and run the cURL version in a terminal.
The page has other limits worth knowing. It sends no cookies, so it cannot use a session you are logged into elsewhere. A secure page cannot call an http:// address other than localhost. The browser drops headers it does not let pages set, such as Cookie, Host and Content-Length, and the page names any it dropped. For a reply from another site, you see only the headers the server chose to expose. A binary reply, such as an image, is reported by its size but not shown as text. And the time shown is measured in the browser, from sending the request to the last byte of the reply, so it includes your own connection.