- 1、本文档共10页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
HTTP 路 由
HTTP routing
路由组件负责将 HTTP 请求交给对应的 action 处理(一个控制器的静态公共方法)
The router is the component in charge of translating incoming HTT P Requests into action calls (a static, public method of a Contro ller).
一个 HTTP 请求在 MVC 框架里被当做一个事件看待。事件包含2 个方面的信息
请求的路径(例如/clients/1524,/photos/list),包含查询字符串(参数字符串) HTTP 方法(GET,POST,PUT,DELETE)
An HTTP request is seen as an event by the MVC framework. The eve nt contains two major pieces of information:
The Request path (such as /clients/1542, /photos/list), includi ng the query string.
The HTTP method (GET, POST, PUT, DELETE)
关 于 REST About REST
表述性状态转移(REST)是一种类似互联网的分布式超媒体软件架构风格,
Representational state transfer (REST) is a style of software arc hitecture for distributed hypermedia systems such as the World Wi de Web.
REST 的几个关键性地方设计准则: 应用功能分散在资源中
每个资源使用一个唯一的 URI 来寻址
所有资源在客户端和资源之间使用一个统一的接口来转移状态
REST states a few key design principles:
Application functionality is divided into resources
Every resource is uniquely addressable using an URI
All resources share a uniform interface for the transfer of sta te between client and resource.
如果你使用过 HTTP,这些接口定义了一些可用的HTTP 方法。这些协议用于访问资源的状态:
*客户端-服务端
*无状态
*缓存
*分层
If you?re using HTTP, these interfaces are defined by the set of available HTTP methods. The protocol used to access the resource state is:
Client-server
Stateless
Cacheable
Layered
如果一个应用遵循了 REST 的主要设计准则,那么这个应用就是REST 风格的。Play 框架使构建 REST 风格的应用变得更容易:
*Play 的路由解释 URI 和 HTTP 方法,将一个请求匹配给一个Java 调用。基于正则
表达式的 URI 模式匹配给你更过的灵活性。
*协议时无状态的,意味着你不能在2 次成功的请求之间在服务器上保存任何状态。
*Play 把 HTTP 当做关键特性,这样框架可以让你接触到HTTP 的所有信息。If an application follows the main REST design principles, the ap plication is RESTFul. The Play framework makes it easy to build R ESTFul applications:
The Play router interprets both URI and HTTP methods to route a request to a Java call. Regular expressions-based URI patterns g
ive you even more flexibility.
The protocol is stateless. This means you can?t save any state on the server between two successive requests.
Play considers HTTP as a
您可能关注的文档
- PEP小学英语六年级上册学科教学计划.docx
- PEP小学英语六年级下册第三单元教案.docx
- PEP小学英语六年级下册教学计划及进度表(表格式).docx
- PEP小学英语三年级上册各单元教学目标.docx
- PEP小学英语三年级下册期末试卷 .docx
- pep小学英语时态总结.docx
- PEP小学英语四年级下册Unit5《My clothes》Part B 教学设计.docx
- PEP小学英语四年级下册第二单元测试题 .docx
- pep小学英语四年级下册教学计划.docx
- PEP小学英语四年级下册期中测试题.docx
- 两个相干源产生波具有3b chmc.pdf
- wifi高性能模块ce fcc rohs认证-xrf report电子档.pdf
- linux pci multiport installation manual多端口安装手册.pdf
- 二章基本概念理论.pdf
- 互联网工程任务组ietfs turnerrfc5940 txt.pdf
- mtz0数学高级证明集合关系群mathematics paper 3 sets relations and groups french.pdf
- 网上书店需求规格说明.pdf
- 系统测试用例pcweb终端.pdf
- apv1 keil环境下接口兼容问题.pdf
- 2023届江西省八所重点中学高三3月联考英语试题(原卷版).docx
文档评论(0)