• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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

 
Ranch Hand
Posts: 2601
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic