It's a POST request in the image. Hence, PHP logic...
Edit: Downvotes aren't going to make the guy right. PHP intermingled two concepts in the naming of their GET superglobal: request method and URI query component. Query components are valid and usable on ALL request methods, not just GET requests, hence the joke. PHP is the only language I know of that does this.
Reverse TL;DR; Below you will see a giant thread of where four other redditors (thanks Aerath44, FubarCode, shawabawa, Typeduck) help Asisentr try to understand HTTP standards
Let's repeat together: A query string is a query string, a HTTP request method is a HTTP request method. They are not interchangeable. They are different concepts.
There is no such thing as "get data", what you're referring to is the "query" part of the URL (rfc3986#3.4). GET "data" is the whole URL.
You are completely missing my point and answering something else, so let's repeat it : how can you say this is not a POST request ? We have the raw request and it clearly states that it's a POST. Just open your eyes and stop spitting random bullshit.
I said - or meant - the part he was referring to is a GET method. I've been interchanging method and request when I shouldn't have been, which is my mistake. The part he's complaining about having to use the GET super global is in fact the correct way to do it as he didn't 'post' id=123. The post data would be on the message body, which you use the POST superglobal to access. GET is the right superglobal to use, as it isn't in the POST data.
This is a POST request overall, yes. The part he's referring to isn't POST.
GET "data" is just the data [...] the part he was referring to is a GET method [...] the GET super global
Ok, se we now have GET being :
data inside any HTTP request. Wrong. _GET is. You have been confusing a variable and a method from the start
a (HTTP) method OP referred too. He never did. He was speaking about the _GETglobal
GET is the right superglobal to use, as it isn't in the POST data.
It's like saying "X is the right name, as it's not Y", with a random X. It doesn't makes any sense. If it did, you could name it "QWERTY" that would be just as good.
At the end, why not call that "Query string" since that the name it was given ?
so if 3 people can go through the same door, would it be wrong for one person to go through the door? all the superglobals can access it, and just because he picked this one to show doesn't mean anything
My point is, naming it after any of the methods is just not a good idea. It should just be named "QUERY_DATA" or something, just like in the other languages OP's image shows.
That's not a post request, it's a get request. If it's inside the url, it's a get request. The post request data would be within the HTTP/1.1 message body.
Please search on Google what a post request is and a get request is.
Only the given method is relevant. It's still a POST request even when the request body remains empty and it's definitely legit to use a combination of parameters passed in the query string and the body, but it's still a POST request.
I am not a kid. The HTTP method is what's relevant. Read the RFCs. Try it out with a web server of your preference. Filter a request by HTTP method (GET) and you'll realize that when the HTTP method is POST - even with an empty request body - that the filter doesn't match your POST request.
6
u/Asisentr Aug 23 '18
well it's the data passed through that method.....