top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to restrict access to Web API method to specific HTTP Verb?

+1 vote
1,755 views
How to restrict access to Web API method to specific HTTP Verb?
posted Aug 25, 2015 by Sathyasree

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Attribute programming plays it's role here. We can easily restrict access to an ASP.NET Web API method to be called using a specific HTTP method. For example, we may required in a scenario to restrict access to a Web API method through HTTP POST only as follows:
[HttpPost]
public void UpdateStudent(Student aStudent)
{
StudentRepository.AddStudent(aStudent);
}

answer Aug 26, 2015 by Shivaranjini
Similar Questions
+2 votes

I want the images should be accessible as part of http page only not by any other mean, no clue any suggestion would have great help.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...