Welcome Guest, Not a member yet? Register   Sign In
The Request class rework
#6

(12-08-2021, 08:21 PM)iRedds Wrote: It seems to me that a possible reason why you do not understand why the get() method works with _POST, and not with _GET, is that you see the http method in the basis of the request, and I see the data.
The get() method works with the current HTTP method. Be it GET/POST/PUST/DELETE/PATCH/etc
That is, get() ! == _GET. get() === get the request data.

get('c', 4) returns 4 because there is no "c" parameter in the current POST request. Therefore, the get() method returns a default value.

I also did not understand your intent.

And I think the `get()` is difficult to understand, because its behavior changes in the context.
I prefer something like `getGet()`, `getPost()`, `getPut()`...
Reply


Messages In This Thread
The Request class rework - by iRedds - 12-07-2021, 11:53 PM
RE: The Request class rework - by includebeer - 12-08-2021, 04:37 PM
RE: The Request class rework - by iRedds - 12-08-2021, 08:21 PM
RE: The Request class rework - by kenjis - 12-09-2021, 07:10 PM
RE: The Request class rework - by kenjis - 12-08-2021, 05:09 PM
RE: The Request class rework - by includebeer - 12-09-2021, 05:28 PM
RE: The Request class rework - by iRedds - 12-09-2021, 09:32 PM
RE: The Request class rework - by kenjis - 12-10-2021, 02:39 AM
RE: The Request class rework - by iRedds - 12-10-2021, 03:04 AM
RE: The Request class rework - by kenjis - 12-10-2021, 04:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB