zoukankan      html  css  js  c++  java
  • REST简介

    之前一直对REST(REpresentational State Transfer)的中文翻译(表述性状态转移)有些疑问,不明白这个表述和转移到底意味着什么,转态在这里又指什么。今天刚好看到一篇文章,现在想想其实我们的翻译就是对英文的直译,相关的词汇要放到英文的语境下意思才能凸显。文章的链接放在下面了,中间摘录几个对于represent和state和transfer的具体英文语境含义有表示的句子,以做备忘

    There is plenty of nuance to consider from Roy Fielding’s original dissertation on REST, but understanding resources is critical to understanding REST. To learn what a resource is, and how it can be represented using APIs, let’s consider my own personal Facebook presence, where I am a resource. I can view an HTML representation of my resource at:

    • GET https://www.facebook.com/kinlane/

    My profile is a single resource available on Facebook. I can view a representation of that resource in HTML using that URL in my web browser. I can also view another representation of it using the Facebook Graph API.

    • GET https://graph.facebook.com/v7.0/me

    这句话说明REST关注的是资源,”represent “指用不同的API表示不同的资源形式

    Naming, organizing, and making digital resources in this way are the seeds of REST. Now that you have your resources well-defined, you can GET these resources. More importantly, you can also manage each resource’s state over time—adding new ones, updating, transforming, and deleting existing ones. This allows for a handful of operations on each resource using HTTP methods:

    • GET: https://graph.facebook.com/v7.0/images
    • POST: https://graph.facebook.com/v7.0/images
    • PUT: https://graph.facebook.com/v7.0/images
    • DELETE: https://graph.facebook.com/v7.0/images

    这段话表明REST关注于以特定的命名形式组织以及使数字资源在互联网上可用,同时资源的状态(“state”,即增删改)也可以随着时间进行转变(“transfer”)

    参考链接:

    https://blog.postman.com/rest-api-definition/

  • 相关阅读:
    解决函数内this指向
    .Math 数值对象
    时间函数
    数学中的弧度和角度
    闭包
    在拖拽元素的时候,如果元素的内部加了文字或者图片,拖拽效果会失灵?
    正则
    JS高级-事件对象
    JS高级-事件捕捉
    JS高级-面向对象
  • 原文地址:https://www.cnblogs.com/marshwinter/p/13653426.html
Copyright © 2011-2022 走看看