Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Feature: ApiController.Created should accept relative URI [1627]

$
0
0
The Location header for HTTP 201 supports relative URIs, but the current code for ApiController.Created (which takes a string URI) does not.
Comments: A couple of other options I can think of: We could introduce a new overload that takes UriKind as a second parameter, which would allow you to do: return Created("foo", UriKind.Relative); Another thing you should be able to do yourself is to override the Created method on a custom base class: public class CustomizedApiController : ApiController { protected virtual override Created(string url) { return Created(new Uri(url, UriKind.RelativeOrAbsolute)); } } (my syntax is probably wrong since I'm typing in a CodePlex text box, but you get the idea.)

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>