2

I need to make a decision between REST and JavaScript CSOM. Which is the best?

2 Answers 2

2

The CSOM is a collection of libraries that acts as a proxy to the server-side object model. The CSOM is not a complete replacement for the server side object model. In SharePoint 2013 it was greatly improved as it got additions for working with search, BCS, taxonomies, workflows and user profiles and etc... From the width of scope wise, it covers a huge scope.

The REST interface on the other hand is mostly brand new in the SharePoint 2013 release. There was a single service in SharePoint 2010 that we could use that enabled read/write to data within a list. There are more positives included such as ease of querying items, testing and so on.

There are positives on both. For example, a person who is much familiar with .NET code could prefer the CSOM. But from the implementation wise, many choose REST over CSOM.

3

It's CSOM all the way when working with managed code (C#/VB). The service proxy generated by Visual Studio for the REST API is unusable so you're pretty much limited to working with HTTP requests and raw XML or JSON if you go the REST route.

It's really a matter of choice when working with JavaScript. The major difference is that CSOM has greater coverage. That is, there are things you can do with CSOM that you can't do with the REST API (e.g. work with managed metadata).

For a much deeper dive into the subject, I suggest you check out David Mann's session from SPC 2014.

Deep dive: REST and CSOM comparison

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.