Monday, 24 December 2018

How to pass an unsecured HTTP request to be re-sent over HTTPS

[RequireHttps] attribute is used to pass an unsecured HTTP request to be sent over HTTPS.

RequireHttps attribute can be applied to a controller class. When it applied on controller class all Controller action method are passed using HTTPS whereas if applied on a specific controller action method then that method only uses HTTPS.

[RequireHttps]
public string Method1()
{
    return "This method should be accessed only using HTTPS protocol";
}

No comments:

Post a Comment