I am trying to raise a HttpResponseException
as described in this screencast (about 1 minute in)
throw new HttpResponseException(HttpStatusCode.Unauthorized);
But the app won't compile as it throws the following error:
The best overloaded method match for 'System.Web.Http.HttpResponseException.HttpResponseException(System.Net.Http.HttpResponseMessage)' has some invalid arguments
The documentation on msdn says it has a constructor that accepts the HttpResponseMessage
enum. http://msdn.microsoft.com/en-us/library/hh835324%28v=vs.108%29.aspx
What am I missing?
Thanks
If you're using the RC, this has changed. Try:
throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With