Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Ranch Hand
Posts: 964
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!