Closed mattbag closed 7 years ago
Can you share the apiUrl
of your WP please? I can check from here
@shprink the-beautyinsider.com.au/wp-json I get 200 with every external test, and can read data using your angular 2 service too
Thanks
I can reproduce. What version of WP/WP-API(if installed) do you use?
Hey, I have 4.7. At the moment it's working with my staging version, so it will be good enough for testing. I will close this since the settings I mentioned at the top should be working for me.
Thanks again for all your amazing works!
Hi, apparently I have a cors issue, and I can't find where to place my headers settings.
In config.cson I tried:
"headers": "Accept": "application/jpg" "Access-Control-Allow-Origin" : "*"
and with anonymous instead of wildcardAlso through the whitelist plugin in config.xml
<access origin="http://the-site.com.au" /> <allow-navigation href="http://the-site.com.au/*" />
The error:
XMLHttpRequest cannot load http://the-site.com.au/wp-json/wp/v2/posts?_embed=true&order=desc&orderby=date&page=1&per_page=5&status=publish. Redirect from 'http://the-site.com.au/wp-json/wp/v2/posts?_embed=true&order=desc&orderby=date&page=1&per_page=5&status=publish' to 'http://the-site.com/wp-json/wp/v2/posts?_embed=true&order=desc&orderby=date&page=1&per_page=5&status=publish' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
I've never had to edit headers in my api source with other tests, but is it what I need to do now in my wp instance? Thanks a lot for this, and for the great project!