Where is the constant for HttpRequest.RequestType and WebRequest.Method values in .NET?
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
When you work with older .NET web APIs, it is easy to assume there must be one official place that defines HTTP verb constants. The answer depends on which API you are using: HttpRequest.RequestType is just a string in classic ASP.NET, while WebRequest.Method is also a string but .NET ships helper constants for several protocol-specific request methods.
What HttpRequest.RequestType Actually Returns
In classic ASP.NET, HttpRequest.RequestType exposes the incoming HTTP method as text such as GET, POST, or PUT. There is no matching HttpRequest constants class that you import and compare against. The value is simply a string.
That means code like this is normal:
If you want constants here, you define them yourself or wrap the logic behind a helper method. In ASP.NET Core, the equivalent modern helper is Microsoft.AspNetCore.Http.HttpMethods.
Constants For WebRequest.Method
WebRequest.Method is also a string property, but the framework includes protocol-specific constants in WebRequestMethods. For HTTP, use WebRequestMethods.Http.
The most common constants are:
- '
WebRequestMethods.Http.Get' - '
WebRequestMethods.Http.Post' - '
WebRequestMethods.Http.Put' - '
WebRequestMethods.Http.Delete' - '
WebRequestMethods.Http.Head'
There are similar classes for FTP and file requests. So the short answer is: there is no HttpRequest.RequestType constants class, but there is a WebRequestMethods.Http class for many WebRequest.Method values.
Prefer Modern HTTP APIs In New Code
WebRequest is an older API and new .NET code usually uses HttpClient together with HttpMethod. If you are starting fresh, the modern version is clearer and easier to test.
Notice the difference:
- '
HttpMethod.Get,HttpMethod.Post, and friends belong toSystem.Net.Http' - '
WebRequestMethods.Http.Getbelongs to the olderSystem.Netstack' - '
HttpRequest.RequestTypein classic ASP.NET remains a plain string'
Knowing which layer you are in avoids a lot of confusion when IntelliSense does not show the constant you expected.
Creating Your Own Shared Constants
If you maintain classic ASP.NET code and dislike magic strings, define a small helper:
Then compare against HttpVerbNames.Post instead of scattering raw string literals through the project. That does not change runtime behavior, but it improves consistency and reduces typos.
Common Pitfalls
The biggest mistake is looking for HttpRequest.RequestType.Get or a similar member on HttpRequest. No such constants exist there.
Another common issue is mixing classic ASP.NET APIs with ASP.NET Core examples. HttpMethods.Get exists in the newer stack, not in the old System.Web request model.
Developers also often assume WebRequestMethods.Http covers every custom verb. For less common verbs, you may still need to assign a string manually.
Finally, WebRequest itself is a legacy API. In new code, HttpClient and HttpMethod are usually the better design choice.
Summary
- '
HttpRequest.RequestTypein classic ASP.NET is a plain string, not an enum or constants class.' - '
WebRequest.Methodis also a string, but .NET provides helpers such asWebRequestMethods.Http.Get.' - Newer .NET applications should generally use
HttpClientandHttpMethod. - If you want verb constants in older code, create a small shared helper and keep comparisons consistent.

