Skip to content
Advertisement

AJAX with XMLHttpRequest doesn’t send data

I want to build a simple program using XMLHttpRequest to calculate the area of the triangle. I used this code for client-side;

JavaScript

This code is for the server side.

JavaScript

Even tried so many codes, It doesn’t send the data to server side.

Advertisement

Answer

I found the mistake. I was sending the parameters as part of the URL, but need to send them as part of the request body.

Client-side code;

JavaScript

Server-side code;

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement