I have a datepicker calendar through jQuery. The user selects a date from the datepicker, which is then passed as a parameter to a function to call that function in the backend in Django, and then that function sends back data that is displayed in table format.
My question when I'm using ajax call in jQuery and passing the date from the front-end to Django, is this going to be a GET request or a POST request? I have seen many codes for this and they set the request type as GET, I wonder why? Isn't it that we are sending info to the backend, and the backend is retrieving that info from the front-end and then passing it to the function?
My understanding of the request was that if we JUST want to retrieve some data, we use GET request, and if we want to send some data from the front-end to the backend, it will be POST request, is this correct?
Does the role change if you are looking from a different perspective, i.e. so instead of saying the front-end is sending data, if we say the backend language like Django is retrieving the data or waiting for it because the function will not get called until the date is passed from the front-end, thus the request could potentially be a GET request?
Sorry if my question is a bit confusing, I can clarify if someone asks me to rephrase it in the comments.