Commit Graph

11 Commits

Author SHA1 Message Date
Kiran Challa acb2a99e9f [Fixes #1283] Add functional tests for WebAPI-style controllers returning HttpContent 2014-10-16 01:52:33 -07:00
Harsh Gupta ebf64ce4e3 Adding HttpResponseException to WebApi Shim. 2014-10-15 09:07:40 -07:00
Ryan Nowak 9ad3d5e68f Separate ApiControllers from MVC Controllers in routing 2014-10-10 13:42:12 -07:00
Ryan Nowak 3968df90e4 Fix issue #1282 - Add Request.CreateResponse extension methods
Adds the set of CreateResponse/CreateErrorResponse extension methods that
return an HttpResponseMessage.

For the overloads that perform content negotiation they will access the
collection of MediaTypeFormatters through the shim options. Note that
CreateResponse and friends use the OLD formatters.

Also, HttpError and CreateErrorResponse assume ErrorDetail == false. Using
the shim you will not get detailed error messages unless you construct the
HttpError instance yourself.
2014-10-10 13:42:09 -07:00
Harsh Gupta 5a83383179 Adding ApiController.Validate : Fixes #1286 2014-10-10 13:42:06 -07:00
Ryan Nowak 22869b41c0 Fix issue #1280 - Add HttpResponseMessageFormatter
Adds a formatter that can convert an HttpResponseMessage returned from an
action into HttpContext.Response output.
2014-10-10 13:42:02 -07:00
Ryan Nowak aad3ae42ca Fix for issue #1281 - Add ModelBinder for HttpRequestMessage
This change adds a ModelBinder that can bind an HttpRequestMessage to an
action parameter.

This builds on an earlier change to construct and store the request
message in the HttpContext via an http feature.
2014-10-10 13:41:59 -07:00
Ryan Nowak e51e0e1d52 Fix for issue #1279 - Add .Request property to ApiController
This change adds a .Request property to the ApiController class that can
be used to access an HttpRequestMessage wrapping the HttpContext.

The HttpRequestMessage is stored in an http feature to make it accessible
to model binders and other infrastructure.
2014-10-10 13:41:55 -07:00
Ryan Nowak 9b11c1d90f Fix #1276 - Implement WebAPI action conventions and overloading
This change adds ApplicationModel conventions that can enable WebAPI
action conventions (verb mapping) and WebAPI overloading.

The conventions activate when a controller has a marker attribute.
ApiController has this attribute, so any ported code will automatically
opt-in.

Also ported some old tests for action selection to our new functional test
framework.
2014-10-10 13:41:50 -07:00
Ryan Nowak 2578b8107f Fix for #1277 - Add Options/Startup API for WebAPI shim
Adds an options class, as well as a default options setup that will
configure the default set of formatters.

Currently most of what options needs to do is a placeholder, but it later
do things like add ApplicationModelConventions, filters, formatters, model
binders, etc. Those will be added in follow up items.
2014-10-10 13:41:46 -07:00
Ryan Nowak d9fe305802 Fix for #1275 - Adding ApiController
This change includes the basic properties that we're providing for
compatability as well as some functional tests and unit tests that verify
that ApiController can be a controller class.
2014-10-10 13:41:42 -07:00