Welcome Guest, Not a member yet? Register   Sign In
Me rindo, no encuentro donde falla el verbo
#4

(This post was last modified: 06-03-2022, 05:56 AM by Worked.)

(06-02-2022, 08:04 PM)iRedds Wrote: english please

Hi.

Quote:Cheers,
I've been struggling for almost an hour with the following code, and I'm pretty sure the problem is in the "verb":

I've used the same path for all three verbs, I've changed the controller name just in case CodeIgniter used the name "Enforce" somewhere in the core, I've try ... N solutions based on my own knowledge and web search, but the result is always the same. GET solves without problems , but when I try to use POST or PUT CodeIgniter returns to the default controller (login) all the time. These are the files:

--- PHP Codes ---

I have CSRF enabled, yes, I have it enabled... but the fact is that in the FETCH request I send the token and csrf code so it shouldn't be the problem (and even if it was for not sending the CSRF token, the truth is that it doesn't even hit the controller)

---- JavaScript Code ---

I'm already driving me crazy... any suggestions?
Thanks.

UPDATE: After posting here, I continued doing a few tests trying to get a clear solution. I've gotten the POST to work over 50% of the cases it hits the controller. I've also gotten the PUT verb to work at 50% too, but using the HTTP spoofing method(1), which doesn't really seem like the best solution to me since it's sending unnecessary parameters and I really wouldn't want to have to fill the API with all those hidden input ="_method".

Thanks

(1) https://codeigniter4.github.io/userguide...ofing.html
Reply


Messages In This Thread
RE: Me rindo, no encuentro donde falla el verbo - by Worked - 06-03-2022, 05:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB