title: What are the differences in using Axios vs jQuery for HTTP requests?
body: <p>I've been a jQuery user since forever. But now I'm building my first API that uses JWT for authentication. This said, most tutorials I find online to consume this API with authentication headers use Axios to make these requests.</p>
  
  <p>I am already using jQuery on the project, so, I would love to make simple jQuery ajax calls, but I'm not sure if there's any hard drawbacks to using it.</p>
  
  <p>This would be my jQuery code:</p>
  
  <pre><code>$.ajax({
    url: "http://localhost:8080/login",
    type: 'POST',
    data: formData,
    error : function(err) {
      console.log('Error!', err)
    },
    success: function(data) {
      console.log('Success!')
      localStorage.setItem('token', data.id_token);
    }
  });
  </code></pre>
  
  <p>Send the Request</p>
  
  <pre><code>$.ajax({
    url: "http://localhost:8080/login",
    type: 'GET',
    // Fetch the stored token from localStorage and set in the header
    headers: {"Authorization": localStorage.getItem('token')}
  });
  </code></pre>
  
  <p>After reading the Axios features, the last one is: <em>Client side support for protecting against XSRF</em> . Does jQuery ajax not support that? Would I have to do anything extra to make this protection? Is there anything else that makes it worth using another library like Axios instead of jQuery?</p>