Exemple #1
0
        //gavdcodeend 03

        //gavdcodebegin 04
        static void SpCsRestFindAppCatalog(Uri webBaseUri, string userName,
                                           string password)
        {
            using (SPHttpClient client = new SPHttpClient(webBaseUri, userName, password))
            {
                object myPayload   = null;
                string endpointUrl = webBaseUri +
                                     "/_api/SP_TenantSettings_Current";
                var data = client.ExecuteJson(endpointUrl, HttpMethod.Get, myPayload);
                Console.WriteLine(data);
            }
        }
Exemple #2
0
        //gavdcodeend 04

        //gavdcodebegin 05
        static void SpCsRestFindTenantProps(Uri webBaseUri, string userName,
                                            string password)
        {
            Uri catalogUri = new Uri(webBaseUri + "/sites/appcatalog");

            using (SPHttpClient client = new SPHttpClient(catalogUri, userName, password))
            {
                object myPayload   = null;
                string endpointUrl = catalogUri +
                                     "/_api/web/GetStorageEntity('SomeKey')";
                var data = client.ExecuteJson(endpointUrl, HttpMethod.Get, myPayload);
                Console.WriteLine(data);
            }
        }