IRestClient interface

Overview

The REST SDK works with the IRestClient interface and can be used through dependency injection. The IRestClient interface has the following primary methods for working with data:

  • GetItem
  • GetItems
  • CreateItem
  • UpdateItem
  • DeleteItem

Use in Sitefinity ASP.NET Renderer projects

The IRestClient interface is automatically registered and is initialized for each request.

To use it, you need to inject it in the constructor through dependency injection (DI), like in the following example:

Use in custom implementations in Sitefinity ASP.NET Renderer projects

To use the IRestClient interface in custom controllers, you need to manually initialize the interface, like in the following example:

Use in custom implementations in external ASP.NET Core projects

To use the IRestClient interface in external projects, which do not use Sitefinity ASP.NET Core Renderer, you need to manually:

  • Register the IRestClient interface on startup by adding the following services:

  • Initialize the IRestClient interface for custom implementations, like in the example above.

Examples

The following examples demonstrate how to use the IRestClient interface:

  • Sample: Migrate data to Sitefinity CMS
  • Sample: Share data between widgets
  • Sample: Mega menu

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?