You can use send data using POST method with jQuery or js or any standard form.
Please check a jQuery POST call example here.
https://guide.freecodecamp.org/jquery/jquery-ajax-post-method/
<script>
// Attach a submit handler to the form
$( "#userForm" ).submit(function( event ) {
// Stop form from submitting normally
event.preventDefault();
// Get some values from elements on the page:
var $form = $( this ),
user_id = $form.find( "input[name='user_id']" ).val(),
url = "https://www.domain.com/api/user/get_avatar/?user_id="+user_id+"&type=thumb";
// Send the data using post
var posting = $.post( url, { s: term } );
//Ajax Function to send a get request
$.ajax({
type: "POST",
url: url,
dataType:"jsonp"
success: function(response){
//if request if made successfully then the response represent the data
$( "#result" ).empty().append( response );
}
});
});
</script>
You can also use POSTMAN to send test REST API calls https://www.getpostman.com/downloads/
or you can also use Advanced REST Client Extension for test api calls https://chrome.google.com/webstore/detail/advanced-rest-client/
-
This reply was modified 4 years, 11 months ago by Ali Qureshi.