Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: Forbidden 403? CSRF!
Post: Forbidden 403? CSRF!

Hi, I've been creative and created a 'dynamic' API (http:// … //) which work great. My problem is, that when I try to add resources by POSTing (or update using PUT), I get a 403 forbidden. Now, acc...
290 Views
0 Replies
02-04-2021, 02:35 AM
blaasvaer
    Thread: JSON formatting in the browser (missing headers)?
Post: RE: JSON formatting in the browser (missing header...

Thanks, but that's just what I already did. This does NOT send a header of type json to the client. I had to do this for that to work: return $this->response->setJSON($this->model->find($id)); Now,...
459 Views
3 Replies
02-01-2021, 06:05 AM
blaasvaer
    Thread: JSON formatting in the browser (missing headers)?
Post: JSON formatting in the browser (missing headers)?

I'm responding from an API using this: Code: -- return $this->setResponseFormat('json')->respond(json_encode($response), 200); -- Now, I would 'expect' the proper headers would be set 'automagic...
459 Views
3 Replies
02-01-2021, 04:28 AM
blaasvaer
    Thread: Cannot login with CI4 after updating Chrome?
Post: RE: Cannot login with CI4 after updating Chrome?

Turned out I had to change the SameSite to Lax ... and remove Secure ... weird that it worked until the update.
616 Views
4 Replies
01-13-2021, 03:39 PM
blaasvaer
    Thread: Cannot login with CI4 after updating Chrome?
Post: Cannot login with CI4 after updating Chrome?

I've updated Chrome, and made sure ALL cookies are allowed ... but I can no longer login to an admin created. I use a third-party 'plug-in' ... but as the author has added absolutely no information ab...
616 Views
4 Replies
01-13-2021, 04:06 AM
blaasvaer
    Thread: WHY do PHP reindex arrays and add integer indexes?
Post: RE: WHY do PHP reindex arrays and add integer inde...

Thank you for the comment.
444 Views
4 Replies
12-21-2020, 06:44 AM
blaasvaer
    Thread: How to avoid having BOTH __construct AND initController!?
Post: RE: How to avoid having BOTH __construct AND initC...

ojmichael Wrote: (12-17-2020, 04:04 PM) -- What do you need to do in __construct that you could not do in initController? -- Probably nothing. But I'm having issues seeing the point of needing init...
674 Views
4 Replies
12-18-2020, 02:30 AM
blaasvaer
    Thread: Dynamic $allowedFields?
Post: RE: Dynamic $allowedFields?

It’s a matter of what’s ‘standard’ in PHP ...
776 Views
6 Replies
12-17-2020, 12:54 PM
blaasvaer
    Thread: Dynamic $allowedFields?
Post: RE: Dynamic $allowedFields?

Thanks, that's what I'm trying to implement myself. But I need access to the $request in my __construct, as that it where I setup everything based on configurations. And I don't get the idea behind...
776 Views
6 Replies
12-17-2020, 09:40 AM
blaasvaer
    Thread: How to avoid having BOTH __construct AND initController!?
Post: How to avoid having BOTH __construct AND initContr...

I'm used to __construct. Now, CI4 no longer use that BUT have 'replaced' it, it seems, with an initController method. This is confusing, at best. And now I have to add this weird initController to ...
674 Views
4 Replies
12-17-2020, 09:12 AM
blaasvaer
    Thread: Access $request in __construct in ResourceController?
Post: RE: Access $request in __construct in ResourceCont...

Yes, that's why I hate that the CI team 'broke' __construct. We've all grown used to being able to use it like we expect to. And now, all of a sudden we have to 'adapt' to these weird custom approache...
377 Views
2 Replies
12-17-2020, 08:55 AM
blaasvaer
    Thread: WHY do PHP reindex arrays and add integer indexes?
Post: RE: WHY do PHP reindex arrays and add integer inde...

OK, like ALL other times, it isn't until I run into a forum and scream and kick in a post, that I find the answer (yes, I may have a theory on this ... for another post another day). There's a HUGE...
444 Views
4 Replies
12-17-2020, 08:40 AM
blaasvaer
    Thread: WHY do PHP reindex arrays and add integer indexes?
Post: WHY do PHP reindex arrays and add integer indexes?

OK, SOMEONE please explain to me me WHY, when passing serialized data from the client to the server, does PHP reindex it all and add integer indexes to my array? Leave it alone, God Dammit! HOW do ...
444 Views
4 Replies
12-17-2020, 08:07 AM
blaasvaer
    Thread: How to get data from serializedArray ... (ResourceController)?
Post: How to get data from serializedArray ... (Resource...

Hi, If I pass data from the client using: Code: -- (ajax) ... data: $(formData).serializeArray(); ... -- I can easily update a record accessing the data like this: Code: -- $data ...
275 Views
0 Replies
12-17-2020, 05:07 AM
blaasvaer
    Thread: Access $request in __construct in ResourceController?
Post: Access $request in __construct in ResourceControll...

How do I access the $request in the __construct of a ResourceController? I've tried: Code: -- $data = $request->getRawInput(); // Crashes with Internal Server Error $data = $request->getVar('s...
377 Views
2 Replies
12-17-2020, 03:29 AM
blaasvaer
    Thread: Dynamic $allowedFields?
Post: Dynamic $allowedFields?

Hi, I've created a dynamic API where the schema for the resource is built on the client based on DB field types (think Content Types in a headless cms). Now, all this dynamic breaks, because I 'have ...
776 Views
6 Replies
12-17-2020, 01:50 AM
blaasvaer
    Thread: HOW to use PUT with ResourceController?
Post: HOW to use PUT with ResourceController?

OK, this has been driving me absolutely nuts for a day now. Can someone please explain to me HOW I could send a PUT request and have it accept an ID and DATA in json-format? WHAT would the route...
445 Views
1 Replies
12-15-2020, 08:44 AM
blaasvaer
    Thread: How do I send the second segment as id to update method?
Post: How do I send the second segment as id to update m...

I 'think' I need to pass a different segment to the UPDATE method on the model in an attempt to update a resource (RESTFully). According to the docs: Code: -- Change the Placeholder Used $rout...
370 Views
1 Replies
12-15-2020, 05:47 AM
blaasvaer
    Thread: Where does $this->model->update(????) get its params from when using the CI's Model?
Post: Where does $this->model->update(????) get its para...

I've created a very clever dynamic RESTFul API where the resource it set dynamically ... BUT, I now face an issue when trying to update a resource. I can't seem to use the 'built in' update method, as...
184 Views
0 Replies
12-15-2020, 05:27 AM
blaasvaer
    Thread: put method not working
Post: RE: put method not working

Well, that may be so. But I can't seem to make a put request using jquery (type = PUT) either. The docs aren't to clear on how to actually 'use' what it tries to explain. I set a route (… ->put …) and...
2,239 Views
4 Replies
12-15-2020, 03:39 AM
blaasvaer

Theme © iAndrew 2016 - Forum software by © MyBB