Creating ASP.NET Web APIs on Azure Web Sites

Last month the new Windows Azure features were released, and one of them which I found quite interesting was the “Web Sites”. Currently I have an account at GoDaddy.com where I host my “pet projects”, and now that Windows Azure has a similar feature at a similar pricing plan (for the preview we can have…

5

CORS support in ASP.NET Web API – RC version

The code for this post is published in the MSDN Code Gallery. A few months back I had posted some code to enable support for CORS (Cross-Origin Resource Sharing) in the ASP.NET Web API. At that point, that product was in its Beta version, and with the Release Candidate (RC) released last month, some of…

6

Lightweight webhosted services with ASP.NET Web API

The code for this post can be downloaded in the MSDN Code Gallery. A couple of weeks back, Youssef Moussaoui posted about a way to create a lightweight service using the ASP.NET Web APIs. His code was built using the self-hosted support for the APIs, and with that we could write a service as simple…

0

Implementing [RequireHttps] with ASP.NET Web API

Quick post today. MVC developers are used to the [RequireHttps] attribute, which is an authorization filter which doesn’t allow any requests to be made over “plain” HTTP. This attribute doesn’t exist in Web API, but it’s fairly simple to replicate the same behavior using an authorization filter (an action filter would work just as well,…

7

Writing FormUrlEncoded data with ASP.NET Web APIs

The code for this post can be downloaded in the MSDN Code Gallery. The FormUrlEncodedMediaTypeFormatter class shipped with the ASP.NET Web APIs beta is one of the default formatters in the Web APIs and can be used to support incoming data from the application/x-www-form-urlencoded media type. This is the default format used for HTML form…

0

Supporting different controller names in ASP.NET Web APIs

The code for this post can be found in the MSDN Code Gallery. For a controller type in the ASP.NET Web API to be accessible, it needs to follow some rules: Be a class Be public Be non-abstract Implement the IHttpController interface (usually via the ApiController class) End with the “Controller” (case-insensitive) suffix That’s fairly…

0

Implementing CORS support in ASP.NET Web APIs – take 2

This post was written for the Beta version of the ASP.NET MVC 4. The updates needed to make them run in the latest bits (Release Candidate) are listed in this new post. The code for this post is published in the MSDN Code Gallery. Last post I showed one way to implement CORS support in…

20

Introducing ASP.NET MVC 4 Beta with Web APIs

There has historically been in Microsoft many ways of doing the same thing. That’s one of the original goals of WCF when it was created: unify the 5 or so different ways of creating distributed applications using the Microsoft stack (ASMX services, COM+, .NET Remoting, MSMQ and one more which I don’t remember). Whether it…

3