restfulAPI
作者:互联网
API
Application Programming Interface: a piece of software that can be used by another piece of software, in order to allow application to talk to each other. such as Web API
"Application" can be other things:
- Node.js' fs or http APIs
- Browser's DOM JavaScript API
- With object-oriented programming, when exposing methods to the public, we're creating an API
REST 架构
rest接口需要满足的要求
-
separate API into logical resources
-
expose structured, resource-based URIs
-
use HTTP methods(verb)
例如addNewTour,getTour,updateTour, deleteTour
-
send data as json
-
be stateless
all state is handle on the client. This means that each request must contain all the information necessary to process a certain request. The server should not have to remenber previous requests. all state is handle on the client. This means that each request must contain all the information necessary to process a certain request. The server should not have to remenber previous requests.
比如【下一页】,应该是发送第x页,而不是currentPage + 1
标签:restfulAPI,methods,process,request,Application,API,each 来源: https://www.cnblogs.com/kihyunBlog/p/16399014.html