I need to make a POST request to an external server from my webpage using Javascript. The body and response are both json. I can\'t figure out how to make this call or what tool
You can use JQUERY and AjAX. You can send/get information information to/from your API either by post or get method.
It would be something like that:
$("#ButtonForm").click(function(){
$.ajax({
url:(Your url),
dataType:'json',
type: 'post',
data: yourForm.serialize(),
success:function(response){
** If yout API returns something, you're going to proccess the data here.
}
});
});
Ajax: http://api.jquery.com/jquery.ajax/