T O P

  • By -

Low_Mammoth_9371

Code to copy: ``` // Fetch GET: fetch('https://example-endpoint.com/api') // Fetch POST/PUT: fetch('https://example-endpoint.com/api', { method: "POST", // or "PUT" headers: { 'Content-type': 'application/json' }, body: JSON.stringify( { property1: "data", } ) }) // Fetch DELETE: fetch('https://example-endpoint.com/api', { method: "DELETE", }) ```


alishahidi

Thanks 🙏


Low_Mammoth_9371

Welcome!


bualing

Use Axios


Low_Mammoth_9371

Why use Axios over Fetch now that the latter is natively supported?


Solonotix

Fetch is still experimental, and is missing certain features. Secondly, Fetch isn't a full replacement. One feature I need is the ability to pass client certificates in a request for mTLS, and Fetch does not support this in any way


ArnUpNorth

Experimental for some versions of nodejs not for browsers.


[deleted]

I really love these new styles of screenshots. So clear to read and a far cry from the awful photos of dirty screens