Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the question mark at the end of filenames mean?

In some project I've met these lines:

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

On server side these files without any extra symbols, so I'm wondering what does the question mark at the end of files mean?

like image 554
megas Avatar asked Jan 30 '12 14:01

megas


3 Answers

The ? in a URL denotes the start of the query string. A ? at the end with no variables following it is usually an unnecessary way of saying "this has absolutely no querystring".

It would be possible with a URL rewriting engine for example, to examine the incoming REQUEST_URI to see if it ends with ? and take a different action than requests not ending in ?, but that would be an unusual usage. It would much more common to just specify some value in the query string.

like image 200
Michael Berkowski Avatar answered Sep 20 '22 00:09

Michael Berkowski


"?" is the separator for supplying arguments via a GET request.

like image 35
Abrixas2 Avatar answered Sep 18 '22 00:09

Abrixas2


? states you're providing arguments via 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

Shai.

like image 45
Shai Mishali Avatar answered Sep 19 '22 00:09

Shai Mishali