CodeIgniter Forums
Remove deprecated Request->getMethod($upper) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Development (https://forum.codeigniter.com/forumdisplay.php?fid=27)
+--- Thread: Remove deprecated Request->getMethod($upper) (/showthread.php?tid=88772)



Remove deprecated Request->getMethod($upper) - ozornick - 11-04-2023

Team, I would like to send a PR to delete @deprecated

Github OutgoingRequest

But this will cause errors in the CLI tests, CURL.. Because since ancient times, methods could be uppercase/lowercase. Now 99% of methods have capital letters (POST, GET,..) Should I delete such mentions and tests? Or is there another option?
Plus I saw that routing also relies on get/post writing. It would be worth fixing this as well


RE: Remove deprecated Request->getMethod($upper) - kenjis - 11-04-2023

I would also like to remove the deprecated features.
However, I expect the impact to be significant.
I want to avoid breaking existing applications as much as possible.

It was deprecated in v4.0.5.
https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_405.html#message-getheader-s

FYI
The HTTP method names are case-sensitive, and it is not "get" but "GET".
Quote:The method token is case-sensitive because it might be used as a gateway to object-based systems with case-sensitive method names. By convention, standardized methods are defined in all-uppercase US-ASCII letters.
https://www.rfc-editor.org/rfc/rfc9110#name-overview



RE: Remove deprecated Request->getMethod($upper) - ozornick - 11-04-2023

What actions?
I know that GET/POST is preferable. Do I need to rewrite the code everywhere for this? Or is PR not needed?
A lot is waiting for get/post now. In this case, the framework will remain with "over 9000" deprecated lines.


RE: Remove deprecated Request->getMethod($upper) - kenjis - 11-05-2023

GET/POST is correct. get/post is just wrong.

One by one. Remove $upper functionality in getMethod($upper) first.
Breaking changes are inevitable, but it will not disappear without removal.


RE: Remove deprecated Request->getMethod($upper) - ozornick - 11-05-2023

I deleted it and that's why I'm asking questions. After removal, you need to fix tests and system files everywhere. And I'm confused, is it worth continuing?


RE: Remove deprecated Request->getMethod($upper) - kenjis - 11-09-2023

I sent a PR https://github.com/codeigniter4/CodeIgniter4/pull/8186
Review, please.