Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
How i can check the request is get or post?
I know i can get it from
C#
System.Web.HttpContext.Current.Request.HttpMethod


But,
C#
hacker who has access to "man in the middle" attacks can amend this data

Is there any other solution i can identify it.

What I have tried:

Hi All,
How i can check the request is get or post?
I know i can get it from
C#
System.Web.HttpContext.Current.Request.HttpMethod


But,
C#
hacker who has access to "man in the middle" attacks can amend this data

Is there any other solution i can identify it.
Posted
Comments
Andy Lanng 25-Apr-16 4:05am    
Nope. The request is an html call which, as you stated, can be changed.
There are features build into asp.net to prevent hacking. If you post a form then is must have the same identifiers as the one the server built. This does include some time stamps, but they are so well known that they can also be hacked, although with much more difficulty.
The best way is to create a request key yourself. Send that to the client for the next request. Each key should be invalid after x minutes.
F-ES Sitecore 25-Apr-16 4:57am    
I can't see any benefit from someone amending the method type. You could check where the posted data is, if it's on the url or in the request body, but if the hacker was going to alter the method he would change where the post data is too.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900