I am using Symfony 4 as Restful API, I was working perfectly with calling the api from a VueJS application. Today, I needed to add an another resource on the api but when I want to call it to get data from Vuejs I get "No 'Access-Control-Allow-Origin' header is present on the requested resource". Only for this entity, for the others it's working.
Symfony 4 api Restful No 'Access-Control-Allow-Origin' header is present on the requested resource, only for one resource
8.4k Views Asked by Y.Coding At
1
There are 1 best solutions below
Related Questions in SYMFONY
- Doctrine batch inserting uses 2GB of Ram
- Adding a callback when reading from an object in Twig
- Using Twig variable in AngularsJS
- Twig : Unescape hexadecimal text
- Symfony : is it better to use a trait or an intermediary class to complete Controller one?
- Symfony 2 form - date widget and validator
- Persisting other entities inside preUpdate of Doctrine Entity Listener
- Symfony2 - Custom annotation loading
- Display a findAll() result in a form
- What is the point of the name method in the symfony2 annotation?
- How to pass a function as a parameter in admin class
- doctrine/migrations incompatible with symfony 2.2.*
- Expected argument of type "string or Symfony\Component\Form\FormTypeInterface"
- Routing problems with AngularJS and Symfony
- symfony and google identity toolkit
Related Questions in CORS
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
- Angular/C# CORS Issue
- CORS in ionic app and django
- Enabling OPTIONS method on Azure Cloud Service (to enable CORS)
- "cross-origin requests that require preflight" - Cors apache configuration
- 405 Method Not Allowed - but Access-Control-Allow-Methods are set
- How to enable CORS between API and angular client
- CORS and CSRF(XSRF)
- Safari turns Simple Cors Request into Preflight after 302 redirect
- Enable CORS in OWIN Self Hosted WebApi
- Moving from development to production and FA icons are now squares
- XMLHttprequest not working the twitch.tv api
- Wso2ESB: Call Rest API through Entitlement policy from client producing CORS issue
- CORS - request made after preflight request expects 'Access-Control-Allow-Credentials' to be true
- CORS on Image Not Working
Related Questions in SYMFONY4
- How can I retrieve my environment variables in a parameter file in Symfony4 structure?
- More than one application per project repository with Symfony 4
- Symfony $form->getData() return empty Object with values concatenated
- Sending "Server Params" through Postman :
- How to attach image to the email using symfony mailer?
- EasyAdmin 3 create custom field
- Datetime range won't select specific date
- Circular referencing in Symfony forms
- how to get the image depend an article in a relation one to many?
- Symfony retrieve Unique values from EAV model
- Symfony/Twig: How to force locale in Twig after setLocale is deprecated
- Symfony API transforming date
- FOS UserBundle UserManager::__construct() must be an instance of ObjectManager
- Symfony4 and Event Dispatcher issue, the script continues 25 seconds after the event
- Implement a custom error controller in Symfony 4.4
Related Questions in NELMIOCORSBUNDLE
- Nelmio Cors , Api how to set for angular2 request's with token headers
- Symfony4. Missing ACAO headers only in static files
- Why CORS policy blocks request only when I dump?
- Can't get Lexik JWT token from other domain
- Symfony FosRest and NelmioCors A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin'
- Should CORS be aware of endpoints method on preflight response?
- CORS issue with Symfony 5 on Chrome
- NelmioCorsBundle with subdomain
- Symfony2: Save Record From Ajax Form Submission
- The 'Access-Control-Allow-Origin' header contains the invalid value 'null'
- Symfony 4 api Restful No 'Access-Control-Allow-Origin' header is present on the requested resource, only for one resource
- "Http failure response for (unknown url): 0 Unknown Error" mobile device
- Symfony 3 HTTP Cache and Cross Origin Headers overwrite
- How to properly allow CORS origin in Symfony API
- Nelmio CorsBundle only applies to OPTIONS | Symfony
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Your problem is related to CORS:
One of the possible solutions can be installing NelmioCorsBundle. This will bring CORS handling directly to your application.
Another solution can be adding this header in your web server (How do I add Access-Control-Allow-Origin in NGINX?).