Visit the following link for a chance to Win a Nokia Lumia 920 with SMDWP.co.uk. All you need is a Twitter account :-
Win a Nokia Lumia 920 with SMDWP.co.uk
Good Luck!
Friday, 6 September 2013
Wednesday, 30 January 2013
Calling WCF REST Service from Jquery causes 405 method Not Allowed and Authorization
I was investigating how to call a REST web service using an Authorization header from jQuery but was running into a cross domain issue. I found the following blog post which detailed changes to the Global.asax :-
http://blog.weareon.net/calling-wcf-rest-service-from-jquery-causes-405-method-not-allowed/
After a bit of head scratching, I found that the above solution required an addition to support an Authorization header.
So from the above blog post, the following line :-
http://blog.weareon.net/calling-wcf-rest-service-from-jquery-causes-405-method-not-allowed/
After a bit of head scratching, I found that the above solution required an addition to support an Authorization header.
So from the above blog post, the following line :-
HttpContext.Current.Response.AddHeader(
"Access-Control-Allow-Headers"
,
"Content-Type, Accept"
);
Needed to read :-
HttpContext.Current.Response.AddHeader(
"Access-Control-Allow-Headers"
,
"Content-Type, Accept,
Authorization"
);
Subscribe to:
Posts (Atom)