Feedback on ASP.NET Web API

Provide a way to easily Mock HttpRequestMessage for an ApiController

Currently it is not easy to Mock or use a DI Container to inject HttpRequestMessage into an ApiController constructor. Therefore, if you are attempting to leverage any common functionality throughout the ApiController class (such as reading common Request Headers), you cannot accomplish this today because HttpRequestMessage is only available at the Method level and not at the time the class is constructed/instantiated. Being able to use DI and Mocking of HttpRequestMessage for an ApiController constructor would be tremendously useful and helpful.

13 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    tfsjunkietfsjunkie shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base