Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger
  • Frits Walraven

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

Ranch Hand
Posts: 1419
  • 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.

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

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

Legend has it that if you rub the right tiny ad, a genie comes out.
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic