Using a REST API using "Astoria" (with .NET Framework 3.5 and VS.NET 2008 SP1)

Hello! I'm really interested in learning how to work with the new .NET Framework 3.5 and VS.NET 2008 SP1 (still beta).

Here is my question:
I would like to use a REST API that is not made by me. I'm talking about the REST API of Community Server 2008 ( I've got the full specification of the API. They have it well documented and ready to go. It appears to be very easy to use, but... HOW? How to connect the web services with the new .NET 3.5 properly?

The full specification can be read here:

I've successully used a DataServiceContext and added a custom HTTP header to use its token-based authentication. The problem comes when I want to, for example, insert a new blog post. How do I invoke the method? Have I to create some kind of query? How do I pass the new element to the service??

The documentation about the method to create a new blog post is as follows (extracted from the website above).

Create Post

POST /api/blogs.ashx/posts/



Note the BlogInfo object can be omitted if you pass the desired Blog Id into the URI Context by posting to /api/blogs.ashx/blogs/{BlogId}/posts

Minimum required fields (Title, Body, and Date)


Status: 201 CREATED
<BlogPost> ...

Can somebody give some example of how to call any of the REST methods using the new Framework?

7/2/2008 12:49:21 AM 7071 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 27
Get it on Google Play
Get it on Apple App Store