Feedback on ASP.NET Web API

Allow HttpRequestMessage to be used with any HTTP method

The http method in HttpRequestMessage is of type HttpMethod, which means there's only 7 methods that can be used:
* Delete
* Get
* Head
* Options
* Post
* Put
* Trace

What about other methods like those for WebDAV (PROPFIND etc.), or 'PATCH', or custom methods?

3 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
completed  ·  Daniel Roth responded  · 

You actually can use HttpRequestMessage with any HTTP verb, including custom ones, by creating an HttpMethod using its public constructor like this:

var patch = new HttpMethod(“PATCH”);
var request = new HttpRequestMessage(patch, uri);

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base