简体   繁体   English

Apex REST和REST API之间的区别

[英]Difference between Apex REST and REST API

谁能告诉我REST API和APEX REST之间的区别。我是REST概念的新手。对此我非常困惑。

The REST API (Force.com REST API) is the generic API provided by Salesforce. REST API(Force.com REST API)是Salesforce提供的通用API。 On the other hand, the Apex REST API is an API written by yourself in apex to provide custom methods. 另一方面, Apex REST API是您自己在apex中编写的API,用于提供自定义方法。

The Force.com REST API is great for things such as CRUD operations. Force.com REST API非常适合CRUD操作之类的东西。 You should write a custom Apex REST API when you want to perform more complicated actions. 当您想执行更复杂的操作时,应该编写一个自定义的Apex REST API。

REST -> architectural style for distributed hypermedia systems. REST->分布式超媒体系统的体系结构样式。

APREX REST -> Apex REST enables you to implement custom Web services in Apex and expose them through the REST architecture. APREX REST-> Apex REST使您能够在Apex中实现自定义Web服务,并通过REST体系结构公开它们。

Second is used to build RESTful web services 第二个用于构建RESTful Web服务

Use the REST API most of the time. 大多数时候使用REST API。 You can access your records and update them like you'd expect. 您可以访问记录并按期望进行更新。 But if you need to do something special, like update two records, and only have the changes saved if both updates were successful, then look at Apex REST, where you can customize what your API call does as much as you like. 但是,如果您需要做一些特殊的事情,例如更新两个记录,并且只有两个更新都成功时才保存更改,那么请查看Apex REST,您可以在其中自定义API调用的功能。

More details in this interview: https://developer.salesforce.com/blogs/tech-pubs/2011/10/salesforce-apis-what-they-are-when-to-use-them.html 采访中的更多详细信息: https : //developer.salesforce.com/blogs/tech-pubs/2011/10/salesforce-apis-what-they-are-when-to-use-them.html

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

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