i have React JS application where i send post request to server with form submission using axios library.
client request:
sendData(data,price) {
axios.post('http://localhost:8080/SampleJavaAPP/UserServer', {
item: data,//these value
price:price//these value
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
}
i am not sure how to get these values into server i am doing in server for getting value like this
String name = request.getParameter("item");
String price = request.getParameter("price");
System.out.println("Result "+name + price);
But it gives null values in server. how to receive these values parameters in server?