We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASP.NET-WebAPI
ASP.NET Web API 是一种框架,用于轻松构建可以访问多种客户端(包括浏览器和移动设备)的 HTTP
ASP.NET Web API
HTTP
服务。
ASP.NET Web API是一种用于在 .NET Framework 上构建RESTful 应用程序的理想平台。
.NET Framework
RESTful
1.REST 是英文 representational state transfer(表象性状态转变)或者表述性状态转移; Rest 是 web 服
REST
representational state transfer
Rest
web
务的一种架构风 格; 使用HTTP,URI,XML,JSON,HTML等广泛流行的标准和协议;轻量级,跨平台,跨语言
URI
XML
JSON
HTML
的架构设计; 它是一种设计风格,不是一种标准,是一种思想。
2.Rest 架构的主要原则:
事务为对象,资源有统一,形式有多样(xml、json 等)
xml
json
每个资源都有一个唯一的资源标识符。
同一个资源具有多种表现形式(xml,json 等)。
对资源的各种操作不会改变资源标识符。
所有的操作都是无状态的。
rest api
url
REST API 是把服务器数据和功能抽象成资源并通过 HTTP 方法进行操作的一种 API 设计风格。
REST API
API
根据 Url 就知道要什么:http://example.com/resources/1
Url
http://example.com/resources/1
根据 http method 就知道干什么:OPTIONS/GET/PUT/POST/DELETE
http method
根据 http status code 就知道结果如何:2xx、3xx、4xx、5xx
http status code
资源描述和操作的分离,所有的数据和功能都被命名成一种资源,并通过 HTTP 的方法操作这些资源。
4.为什么会出现 restful?
restful
在 Restful 之前我们写一个 web 请求,格式通常是这样的:
Restful
"/product/query/1" 根据用户 id 查询商品
"/product/Add" 新增商品
"/product/update" 修改商品
"/product/delete" 删除商品
Restful 用法:
"/product/1" GET 根据用户 id 查询商品
"/product/" POST 新增商品
"/product/" PUT 修改商品
"/product/" DELETE 删除商品
restful 风格其实就是根据请求的类型(get、post、put、delete)来匹配对应的方法。
get
post
put
delete
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ASP.NET WebAPI2
什么是
ASP.NET-WebAPI
?ASP.NET Web API
是一种框架,用于轻松构建可以访问多种客户端(包括浏览器和移动设备)的HTTP
服务。
ASP.NET Web API
是一种用于在.NET Framework
上构建RESTful
应用程序的理想平台。关于
RESTful
的理解1.
REST
是英文representational state transfer
(表象性状态转变)或者表述性状态转移;Rest
是web
服务的一种架构风 格; 使用
HTTP
,URI
,XML
,JSON
,HTML
等广泛流行的标准和协议;轻量级,跨平台,跨语言的架构设计; 它是一种设计风格,不是一种标准,是一种思想。
2.
Rest
架构的主要原则:事务为对象,资源有统一,形式有多样(
xml
、json
等)每个资源都有一个唯一的资源标识符。
同一个资源具有多种表现形式(
xml
,json
等)。对资源的各种操作不会改变资源标识符。
所有的操作都是无状态的。
rest api
? 在url
上有什么特点?REST API
是把服务器数据和功能抽象成资源并通过HTTP
方法进行操作的一种API
设计风格。根据
Url
就知道要什么:http://example.com/resources/1
根据
http method
就知道干什么:OPTIONS/GET/PUT/POST/DELETE根据
http status code
就知道结果如何:2xx、3xx、4xx、5xx资源描述和操作的分离,所有的数据和功能都被命名成一种资源,并通过
HTTP
的方法操作这些资源。4.为什么会出现
restful
?在
Restful
之前我们写一个web
请求,格式通常是这样的:"/product/query/1" 根据用户 id 查询商品
"/product/Add" 新增商品
"/product/update" 修改商品
"/product/delete" 删除商品
Restful
用法:"/product/1" GET 根据用户 id 查询商品
"/product/" POST 新增商品
"/product/" PUT 修改商品
"/product/" DELETE 删除商品
restful
风格其实就是根据请求的类型(get
、post
、put
、delete
)来匹配对应的方法。The text was updated successfully, but these errors were encountered: