开发者

Is this RESTful URL (http://api.twitter.com/1/statuses/retweet/id.format)?

开发者 https://www.devze.com 2023-03-12 01:01 出处:网络
I\'ve come across a Twitter REST API Method: statuses retweet which they say is RESTful. But I am confused now with the knowledge I have about RESTful API.

I've come across a Twitter REST API Method: statuses retweet which they say is RESTful. But I am confused now with the knowledge I have about RESTful API.

Every URI should contain nouns only not actions, but in this URI I think 'retweet' is an action or a verb in a sense. Is this RESTfu开发者_运维知识库l or am I missing anything or misunderstood this principle?


I wouldn't get too hung up on what a URI looks like but in this case, you can think of a retweet as a Resource and that you are creating a retweet when you POST to that URI. If you also look at other methods there is a "retweets" resource the GETs all the retweets.

Now it would be not considered RESTful style if the web service did something like this:

POST http://api.twitter.com/1/statuses?action=retweet&id=1&format=json, that would be more RPC.

0

精彩评论

暂无评论...
验证码 换一张
取 消