New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the Community Exchange, where community members ask and answer questions about DNN. To get started, just start typing your question below and either select one of the suggested questions or ask a new question of your own.

DNN 8 CORS WebAPI 2.0

Return to previous page

  • 2/6/2016
  • 3872 Views
  • 1 Answer
  • Last Activity: 6 years ago, Jacques

Question:

Andrew Burton 9 years ago

I am looking to expose some web services publicly so I need to enable CORS for cross domain POSTING.

I seem to be able to get it to work for GET calls by adding response.Headers.Add("Access-Control-Allow-Origin", "*"); before I return the results.

However, when posting, the server seems to reject the request before it makes it to my HttpResponseMessage function.

Any ideas how I can incorporate this, it's rather important to the project.


Many thanks,

--A

DNN 8 CORS WebAPI 2.0

Andrew Burton
Andrew Burton 9 years ago
Add an Answer

Answers

Sign In to Participate
Or register to become a member