Jquery AJAX Post Request REST API

We are going to make Jquery form data ajax post request.

Basically we have used jquey ajax to make our api call which is of form data type  and the response we are going to get is in json format.

<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
      var formDataSet;
    formDataSet = new FormData();
        url: 'https://testserver.com/api/login',
        headers: {
        data: formDataSet,
        processData: false,
          contentType: false,
        type: 'POST',
        success: function(data){
          console.log('succes: '+data);
<h2>AJAX REST-API Post Request(form-data)</h2>
<button>Get External Content</button>


Leave a reply

your email address will not be published. required fields are marked *

Name *
Email *