sprintcube / cakephp-rest Goto Github PK
View Code? Open in Web Editor NEWCakePHP REST Plugin - Easily build REST API endpoints in your CakePHP application.
License: MIT License
CakePHP REST Plugin - Easily build REST API endpoints in your CakePHP application.
License: MIT License
Hi,
Firstly, thanks for your work !
I installed your plugin, I am working with CakePHP 3.7.
The problem is that I can't acceed to my page to add an user for example.
The error message is :
CSRF token mismatch. Cake\Http\Exception\InvalidCsrfTokenException
Documentation API
If you want to customize this error message, create src/Template/Error/error400.ctp
toggle vendor stack frames
⟩ Cake\Http\Middleware\CsrfProtectionMiddleware->_validateToken CORE/src/Http/Middleware/CsrfProtectionMiddleware.php, line 120
I understand that the problem is about the CSRF, I tried to resolved with a lot of solution but nothing to do, I don't understand why.
I tried to change the route, to remove :
// $routes->applyMiddleware('csrf');
All solutions to disable the CSRF on this page what I found on internet (Google) don't work.
When I access to the page for the view without send POST, the page works.
Thank you by advance.
When debug is false and i throw exception it renders html error instead of json with status NOK and exception message,
What am I missed?
Hi, i'm trying to get a serialized result to ommit the name or variable on result.
How can i get the same result like using the $this->set('_serialize', 'varname'); in this plugin?
i want to get a result like this
{ "status": "OK", "result": { "falanu": [ "dhikanu", "tamburo" ] } }
instead of:
{ "status":
"OK","result": { "bar": { "falanu": [ "dhikanu", "tamburo" ] } } }
without putting the name variable what i'm using in the response
thank you
hi!
I think this part: class AppController extends BaseController
BaseController should be taken from
use Cake\Controller\Controller as BaseController;
not from
use App\Controller\AppController as BaseController;
As App\Controller\AppController may have logic which interfer with API logic
Hello, Sir
I am using this library but I do not create a POST API.
I am Using CakePHP 3.6
I am using Cake PHP 3.4.2 and install this plugin using this command composer require sprintcube/cakephp-rest
Then I followed this simple tutorial https://www.codementor.io/@narendravaghela/building-rest-apis-using-cakephp-3-x-k9br8qo2a
But got the error code Call to undefined method App\Controller\ErrorController::getResponse()
I do not understand why getResponse() undefined method in /vendor/sprintcube/cakephp-rest/src/Error/RestExceptionRendered.php file
Please give me some insights
Is there any chance of an official update to this plugin to support CakePHP 4?
At present, we are updating an application, and have successfully ported everything to Cake4 via the upgrade guide.
The last step is the actual update to CakePHP 4 via a composer update, which can't happen while the sprintcube/cakephp-rest
plugin is requiring "cakephp/cakephp": "^3.4.0"
Please add support for version 4.
Pass status code manually
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.