CLIENT SIDE HTTP REQUEST

The jQuery library can make HTTP requests from the client side of an app to the server via AJAX (Asynchronous JavaScript and XML). Asynchronous means that the process will take an unknown amount of time and Javascript and XML refer to the type of data associated with an http request.

$.ajax({
method: 'POST,
url: 'https://opertationspark.org/user,
data: JSON.stringify({username: 'maxgaudin', password: 'supersecret'}),
dataType: "json",
success: function(response) { console.log(response); },
error: function (request, status, error) {
console.log(request.responseText);
}
});

The ajax request takes the form of an object containing key value pairs of the data associated with the http request: the type of http method, url, data, and datatype, success message, and an error message.

Like what you read? Give Uraeus Millet a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.