What does the question mark at the end of the file names mean?

In some project, I met these lines:

$.get("defaults/data.json?", ...); $.get("defaults/structure.html?", ...); $.get("defaults/style.css?", ...); 

On the server side, these files are without any extra characters, so I wonder what the question mark at the end of the files means.

+6
source share
3 answers

? in the URL indicates the beginning of the query string. A ? in the end, without any variables following it, it is usually an unnecessary way to say "it has absolutely no query."

It would be possible, for example, using a URL rewrite mechanism to check the incoming REQUEST_URI to see if it ends with ? , and perform a different action than queries that do not end in ? , but it will be an unusual use. It would be much simpler to specify some value in the query string.

+5
source

"?" is a separator for supplying arguments through a GET request.

+5
source

? states that you provide arguments through an HTTP GET.

For example, if you want to send a = 1 and b = 2, you would do http://mysite.com/myfile.php?a=1&b=2

Shay.

+2
source

Source: https://habr.com/ru/post/907236/


All Articles