Guidance on pulling JSON data send through textarea

Guidance on pulling JSON data send through textarea

Hello

I am new in Jquery.I have a HTML form with textarea and a button,I have mapped the button to Javascript action and send the data entered to a REST API and pull JSON data and show same.I am using REST API of GATE cloud for sentimental analysis.I have the key and password.Kindly tell me how to structure the JSON script and format the URL with POST data containing api key and password

I wanted the javascript to handle in the manner

(function ($) {
    $('button').on('click', function () {
        // remove resultset if this has already been run
        $('.content ul').remove();
        // add spinner to indicate something is happening
        $('<i class="fa fa-refresh fa-spin"/>').appendTo('body');
 
        // send data from textarea
        
 
        // make the AJAX request
 $.getJSON       , function (data) {
 
            // do all this on success       
            
}(jQuery));