Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

forbidden message for Spring REST POST request with ACCESS_CONTROL_ALLOW_ORIGIN set to allow all  RSS feed

 
Ranch Hand
Posts: 1019
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a spring REST POST web service with cross origin headers set as below:

However I get message saying forbidden when sending POST request from browser.The post request works fine from postman or Apache Rest Client.






thanks
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know its not your rest service code its your server which is creating problem here. If server is not allowing ACCESS_CONTROL_ALLOW_ORIGIN then setting it in code will not work.

Which serve you are using and which API ?

One more point no days browsers are not supporting Cross-Origin Resource Sharing. Please check this link

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

It says clients will not be allowed to gain resource access if it exists on other domain.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!