![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
REST
纵横南北
因为年轻所以流浪
展开
-
使用PHP创建一个REST API(Create a REST API with PHP) 节选1
最近项目需要用到REST,故收集相关资料。 One of the latest (sort of) crazes sweeping the net is APIs, more specifically those that leverage REST. It’s really no surprise either, as consuming REST APIs is so i转载 2013-03-25 13:41:29 · 535 阅读 · 0 评论 -
使用PHP创建一个REST API(Create a REST API with PHP) 节选2
Responses 响应 So, REST handles requests very easily, but it also makes generating responses easy. Similar to requests, there are two main components of a RESTful response: the response body, and a转载 2013-03-25 13:45:18 · 561 阅读 · 0 评论 -
使用PHP创建一个REST API(Create a REST API with PHP)节选5
Now that we can interpret the request, let’s move on to sending the response. We already know that all we really need to do is send the correct status code, and maybe some body (if this were a GET r转载 2013-03-25 13:47:31 · 675 阅读 · 0 评论 -
使用PHP创建一个REST API(Create a REST API with PHP)节选6
You could also take it a step further than that, and abstract out your API controller and data models a bit more. Rather than explicitly creating a controller for every data model in your app, you c转载 2013-03-25 13:49:21 · 732 阅读 · 0 评论 -
使用PHP创建一个REST API(Create a REST API with PHP) 节选3
Getting Started with REST and PHP 开始使用PHP写REST One last disclaimer: the code we’re about to go over is in no way intended to be used as an example of a robust solution. My main goal here is to转载 2013-03-25 13:46:04 · 536 阅读 · 0 评论 -
使用PHP创建一个REST API(Create a REST API with PHP) 节选4
There are a few ways we could go about doing this, but let’s just assume that we’ll always get a key/value pair in our request: ‘data’ => actual data. Let’s also assume that the actual data will be转载 2013-03-25 13:46:41 · 524 阅读 · 0 评论