简体   繁体   English

是Web Api REST服务

[英]Is Web Api REST Service

Now, this may be really a stupid question, but i would like to know if ASP.Net Web APIs are actually REST Services at all? 现在,这可能确实是一个愚蠢的问题,但是我想知道ASP.Net Web API是否真的是REST服务? If so, what REST rules does it comply. 如果是这样,它遵循什么REST规则。

I have gotten into argument with people saying it is REST but wanted to confirm. 我已经与人们争论说它是REST,但想确认一下。 Also i shall be glad, if someone can suggest actual REST protocols/standard which any service need to comply to be called a REST service. 如果有人可以建议任何服务都需要遵守的实际REST协议/标准,那么我也将感到高兴。

I also implemented a Web API Service, with different routing ie {domain}/{controller}/{id}/{somethingelse-maybe} and also {domain}/{controller}>id=&name= 我还实现了Web API服务,它使用不同的路由,即{domain} / {controller} / {id} / {somethingelse-maybe}和{domain} / {controller}> id =&name =

Does using the resources to use Query string does not qualify my service as RESTful? 使用资源使用查询字符串是否不使我的服务具有RESTful资格? Which of the above is correct? 以上哪一项是正确的? Can i use mixed routing in my service at all? 我可以在服务中完全使用混合路由吗?

Please help. 请帮忙。

Cheers !!! 干杯!

By definition REST means, that the service fulfills every required REST constraint . 顾名思义,REST是指服务满足所有必需的REST约束

The words REST and RESTful were exhausted by ppl who probably never read about these constraints. REST和RESTful一词已由ppl穷尽,他们可能从未读过这些约束。 The term Web API is for applications which violate the HATEOAS constraint . 术语Web API是指违反HATEOAS约束的应用程序。 The term hypermedia API is for applications which fulfill the HATEOAS constraint. 术语超媒体API用于满足HATEOAS约束的应用程序。 Most of the so called REST applications or REST APIs violate one or more constraints... ( ref ) 大多数所谓的REST应用程序或REST API违反了一个或多个约束...( ref

The URI structure is not a REST concern. URI结构与REST无关。 You identify a resource with one or more URIs, but a single URI cannot be assigned to multiple resources (the query is part of the URIs). 您使用一个或多个URI标识资源,但是不能将单个URI分配给多个资源(查询是URI的一部分)。 That's all you need to know. 这就是您所需要知道的。 (Nice IRIs are for routing purposes, and probably for check the validity of the URI-resource mapping.) (好的IRI用于路由目的,并且可能用于检查URI资源映射的有效性。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM