Gabriele Ferro Home

Send a POST request

Day 48: 21 September 2020

Since yesterday I've been trying to write JavaScript code for my 5th OpenClassRooms project to send a POST request to the backend.

I started by following THIS page of mozilla documentation.

Although I already know that in the end I will have to replace my XMLHttpRequest with Promises, I find it useful to take gradual steps based on what I already know.

So I went over the last topics I studied using different websites.

First of all an introduction on AJAX and JSON using w3school seemed necessary to me.

Then, I studied again some parts of the JavaScript course provided by OpenClassRooms. In particular, how to listen to events and how to send data with a POST request.

**Today’s Progress:**

Using the submit method and the mozilla documentation page on how to retrieve data from the server I wrote this code.


The documentation page will come in handy when I need to convert the code using the fetch method.

I have yet to figure out how to retrieve the server response.

**Link to tweet:**

[twitter-follow screen_name='20Gabriele20']

February 2024


Gabriele Ferro Home
Copyright © Ferro Gabriele. All rights reserved.