Comments (11)
Update: Reading an extensive mozilla article on the subject. I will implement a fix.
from php-crud-api.
Request header field Content-Type is not allowed by Access-Control-Allow-Headers.
I fixed this one in b4051e9 by adding: Access-Control-Allow-Headers: Content-Type
Can you try again? I would like it to work without the Chrome CORS extension.
from php-crud-api.
small detail (probably not the issue): "99" has a trailing comma
from php-crud-api.
I think the problem is with the options request, let me test it locally. Hang on..
from php-crud-api.
Update: I confirmed it is the "pre-flight" or "options" request that gives a 404.
from php-crud-api.
Update: Should be fixed in 54e312f
from php-crud-api.
Please let me know whether or not it works for you.
from php-crud-api.
It works great !!!, thank you very much. you saved me.
Just something for documentation, you must use an extension for CORS or add the header "header ('Access-Control-Allow-Origin: *');" api.php in the file to allow make the request.
Thanks again for your time, keep it up !!!
Noob developers appreciate this help !!!
from php-crud-api.
@0noel0 Does the latest version still need the extra "header('Access-Control-Allow-Origin: *');" call? That should not be necessary. Please let me know.
from php-crud-api.
I had not really tested the effect of the header, it does not affect whether or not it gets, but the extension of CORS if necessary.
This is the error in console without the extension:
XMLHttpRequest cannot load http://localhost/mysql-crud-api/api.php/cap/1/. Request header field Content-Type is not allowed by Access-Control-Allow-Headers.
I use the CORS (Chrome extension)
URL:https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?utm_source=gmail
And to enable this extension does not return the error appears.
Only return 1 (Success).
But as far as if this is not an error.
from php-crud-api.
Added an AngularJS example in d69fa4d
from php-crud-api.
Related Issues (20)
- Filter results if joined table has an authorization.recordHandler HOT 3
- HTML Middleware HOT 2
- Update with "where" HOT 8
- "Request Tranformer" middleware HOT 2
- Azure App Service HOT 1
- Add PHP backend to any app project with one command HOT 1
- Any advice on events integration? HOT 2
- Synchronization between local IndexedDB and MySQL Database. HOT 3
- Can the API Support Customized Cache Management for Specific Tables? HOT 9
- Question: Add property on create HOT 3
- Insights on caching with Redis HOT 2
- Using Customization handler to insert app-generated ID HOT 11
- PUT using curl comes back successful but the record is not actually updated HOT 2
- Suggestion to modify response JSON root Key (records) HOT 2
- firebase jwt public key rotation HOT 5
- "Route '' not found" HOT 3
- Additional SQL queries in authorization handlers HOT 2
- Direct usage of PHP CRUD API functions in external PHP Files HOT 8
- Failure on postgres when table name is domains HOT 10
- Returning user uploaded file using custom controller HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-crud-api.