Site

Site

Reference the library

// JavaScript
var $REST = require("gd-sprest");

// TypeScript
import { List, Web } from "gd-sprest";

Get the current site collection

// Get the site
$REST.Site()
    // Execute the request
    .execute(function(site) {
        // Code goes here
    });

// Get the site
Site()
    // Execute the request
    .execute(site => {
        // Code goes here
    });

Get the root site collection

// Get the root site
$REST.Site("/")
    // Execute the request
    .execute(function(site) {
        // Code goes here
    });

// Get the root site
Site("/")
    // Execute the request
    .execute(site => {
        // Code goes here
    });