views:

379

answers:

4

Instead of using the web services infrastructure provided by .net, I was wondering what your take on rolling my own asp.net page that you can post data to (I guess all the cool kids are calling this REST,) and retrieving a JSON response from. Is there additional overhead in using an aspx page for this purpose that i'm not aware of?

+1  A: 

Even if you'd use existent helper classes, you'd have to implement your own message parsing (including error handling etc.) and thus lose transport transparency (would require more effort to switch to other protocols/formats) unless you implement a communication infrastructure similar to WCF's. And then you might need additional features such as security..... just use WCF if you can ;)

Josef
A: 

You might want to check this post out.

JP Alioto
+2  A: 

Yes and no. You can use ASP.NET, even without MVC, to handle this rather effectively. But you probably don't want to use pages. Rather, you should implement IHttpHandlers for your rest actions.

As for handling the JSON angle, check out JSON.NET if you don't want to use the baked-in WCF/Scripting stuff.

Wyatt Barnett
+1  A: 

Actually, if I may, the cool kids are calling REST something that is not ReST at all.

http://serialseb.blogspot.com/2009/06/fighting-for-rest-or-tale-of-ice-cream.html

serialseb