I have googled about the docs of rest, but I am not exactly sure I understand it.
What I can see in rest is that its URL is clean, for example:
http://host/webservice.asmx?name=xname&type=xtype
If in REST style, it is perhaps:
http://host/webservice.asmx/xname/xtype
Isn't it?
So I just found the URL is cleaner, but I can not find any other advantages.
Can anyone tell me more?
I have some more questions:
I found that some application built on Ruby-on-Rails all use the clean URL, for example:
http://xxx/blog/list
http://xxx/blog/edit/1
http://xxx/blog/1
So is there any relationship between them?
URL rewriting
Is URL rewriting one of the ways to implement REST?
We have some web service built on ASP.NET, are there any ways to change that to a REST architecture?
UPDATE:
I have read this article(rest-to-my-wife),it seems that using the verbs provided by http(post/get/put/delete) we can do different operation to a resource using the same url just put the realated data in the http body; for example,I want to create a new order:
POST http://www.store.com/order,
<purchase-order>
<item> ... </item>
</purchase-order>
But I still have some questions:
1) how we set the http body in the page?
ANother example,I want to delete an order:
Delete http://www.store.com/order/1
But in the page,the url is just a link,
Mabye it is like this:
delete this order
it is static,how can we tell the browser that when it send this url to the server,it should use the "delete" manner rather than "get"?
2) is it will cause the extra work in server side?
Since we may send the same url with different http method(get/post...) to the server,so the server may have to parse the http header and body to make sure what operation the user want to do for this url(maybe using the 'resource' instead of 'url' is better,but I can not tell the difference between url and uri and resouce)?
Take the same url for example:
http://www.store.com/order/1
If the server find that the http method is "get",he may know that "oh,this guy just want to get the info of the order whose id is 1",if the method is "delete",he know "oh,this guy want to delete the order whose id is 1".
So it seems that this manner will transfer the extra work from client side to server side.
Which I mean that in the client the url is all the same,it is easier,but for the server side it need more work,is this true?