Which method from GET
or Post
is more suitable to use for the code displayed below and what are its advantages from one another?
The code is supposed to return data based on a user's location.
function findPark (latitude,longitude) {
var myReq = new XMLHttpRequest();
var serviceURL = "https://www.ratemyPlace.prg/getRating?";
serviceURL += "lat=" + latitude;
serviceURL += "&lng=" + longitude;
myReq.addEventListener("load", myListener);
myReq.open("GET", serviceURL);
myReq.send();