Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started with REST [closed]

I am looking for some good links with best practices and sample code on creating RESTful web services using .NET.

Also, any other input you might have regarding REST would be greatly appreciated.

like image 744
mattruma Avatar asked Sep 13 '08 11:09

mattruma


People also ask

Is it hard to learn REST API?

Easy to Learn and Implement Talking about the architecture, REST is based on the client-server architecture where the client is completely separated from the server.

How do I get started with API?

The easiest way to start using an API is by finding an HTTP client online, like REST-Client, Postman, or Paw. These ready-to-use tools help you structure your requests to access existing APIs.

How do I start my REST API server?

REST Setup First, follow the instructions and install Docker. Then, once you've completed the installation, you can download and run our sample REST server. Docker downloads the server image and runs it. The command tells it to make the web server available on port 8080.


1 Answers

ADO.Net Data Servcies makes it really easy to build and consume RESTful web services in the .Net world but nevertheless understanding the concepts is important. Compared to WCF (which added REST support later), ADO.Net Data Services was built primarily for REST.

Guidelines for Building RESTful Web Services has all the info on the resources you need.

This is another useful blog entry:

The uniform interface constraints describe how a service built for the Web can be a good participant in the Web architecture. These constraints are described briefly as follows :

1) Identification of resources: A resource is any information item that can be named and represented (e.g. a document, a stock price at a given point in time, the current weather in Las Vegas, etc). Resources in your service should be identified using URIs.

2) Manipulation of resources via representations: A representation is the physical representation of a resource and should correspond to a valid media type. Using standard media types as the data formats behind your service increases the reach of your service by making it accessible to a wide range of potential clients. Interaction with the resource should be based on retrieval and manipulation of the representation of the resource identified by its URI.

3)Self-descriptive messages: Following the principles of statelessness in your service's interactions, using standard media types and correctly indicating the cacheability of messages via HTTP method usage and control headers ensures that messages are self descriptive. Self descriptive messages make it possible for messages to be processed by intermediaries between the client and server without impacting either.

4)Hypermedia as the engine of application state: Application state should be expressed using URIs and hyperlinks to transition between states. This is probably the most controversial and least understood of the architectural constraints set forth in Roy Fielding's dissertation. In fact, Fielding's dissertation contains an explicit arguments against using HTTP cookies for representing application state to hammer this point home yet it is often ignored.

like image 169
Gulzar Nazim Avatar answered Oct 08 '22 02:10

Gulzar Nazim