Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand

More REST Examples

Posted by Jean Paul on June 15, 2015


In this article we can explore more REST and examples.

Get a List by Title

We can get List information using the Title of the list. Make sure you have a list named Contacts.

URL: http://server/_api/Web/Lists/GetByTitle(‘Contacts’)

image

Please note that REST API is provided using the context _api.

Using chrome browser I received the following output.

image

Although IE 11 hesitated to show the output, giving an error message.

image

But in IE too, we can view the output using View Source option.

image

image

By default XML format result is provided by SharePoint REST services. In programmatic way, we can format these results to JSON format.

Getting List Items

We can try getting the list items using REST.

URL: http://sharepoint/_api/Web/Lists/GetByTitle(‘Contacts’)/Items

Using chrome browser I was able to view the following results.

image

However In IE the result summary was shown.

image

image

Please note that REST is trending as a replacement for JSOM in SharePoint world. REST provides much easier, less-coded ways of working with client-side object model.

References

https://msdn.microsoft.com/EN-US/library/office/jj164022.aspx

Summary

In this article we have explored few REST examples using browser URL box.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s