Container for data used to make requests
Inheritance: IRestRequest
        public string ActivateFeature(string baseSiteUrl, string user, string password, string domain)
        {
            if (baseSiteUrl.EndsWith("/"))
                baseSiteUrl += "_api/";
            else
                baseSiteUrl += "/_api/";

            RestClient rc = new RestClient(baseSiteUrl);
            NetworkCredential nCredential = new NetworkCredential(user, password, domain);
            rc.Authenticator = new NtlmAuthenticator(nCredential);

            RestRequest request = new RestRequest("contextinfo?$select=FormDigestValue", Method.POST);
            request.AddHeader("Accept", "application/json;odata=verbose");
            request.AddHeader("Body", "");

            string returnedStr = rc.Execute(request).Content;
            int startPos = returnedStr.IndexOf("FormDigestValue", StringComparison.Ordinal) + 18;
            int length = returnedStr.IndexOf(@""",", startPos, StringComparison.Ordinal) - startPos;
            string formDigestValue = returnedStr.Substring(startPos, length);

            request = new RestRequest("web/features/add('de646322-53f3-474d-96bf-0ea3670a0722',false)", Method.POST);
            request.RequestFormat = DataFormat.Json;
            request.AddHeader("Accept", "application/json;odata=verbose");
            //request.AddHeader("Body", "");
            request.AddHeader("Content-Type", "application/json;odata=verbose");
            request.AddHeader("X-RequestDigest", formDigestValue);
            IRestResponse response = rc.Execute(request);
            string content = response.Content;

            return content;
        }
Example #2
1
        public async Task<bool> IsValidKey(string key)
        {
            try
            {
                var client = new RestClient("http://" + _serverAdress);
                var request = new RestRequest("getProductKeyValid.php", Method.GET);
                request.AddParameter("productkeys_Key", key);

                request.Timeout = 5000;
                IRestResponse response = await client.ExecuteGetTaskAsync(request);
                //only throws the exception. Let target choose what to do
                if (response.ErrorException != null)
                {
                    throw response.ErrorException;
                }
                var model = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(response.Content);
                //if string equals "1" the key is not activated yet
                if (model.Equals("1"))
                    return true;
                return false;
            }
            catch (Exception e)
            {
                return false;
            }
        }
Example #3
0
 public RestRequest CreateAccessToken()
 {
     var request = new RestRequest(Method.GET);
     request.Resource = "{version}/oauth/access_token";
     request.AddParameter("version", _version, ParameterType.UrlSegment);
     return request;
 }
        /// <summary>
        /// Sends the formatted messages.
        /// </summary>
        /// <param name="messages">The messages to send.</param>
        /// <param name="succeededAction">A success action that should be called for successfully sent messages.</param>
        /// <param name="failedAction">A failure action that should be called when a message send operation fails.</param>
        public void Send(IEnumerable<ProviderNotificationMessage> messages, 
            Action<ProviderNotificationMessage> succeededAction, 
            Action<ProviderNotificationMessage, Exception> failedAction)
        {
            foreach (var message in messages)
            {
                try
                {
                    // create a new rest request and add the message to the http message body
                    var request = new RestRequest(Method.POST);
                    request.AddJsonBody(message);

                    // send the POST request and call success action if everything went fine
                    _client.Post<ProviderNotificationMessage>(request);
                    if (succeededAction != null)
                        succeededAction(message);
                }
                catch(Exception e)
                {
                    // if the post fails call the failedAction
                    if(failedAction != null)
                        failedAction(message, e);
                }
            }
        }
Example #5
0
 public List<Customer> GetCustomers()
 {
     const string resourceName = "customers";
     var request = new RestRequest(resourceName, Method.GET);
     var customers = Execute<CustomerList>(request).Customers;
     return customers;
 }
        //TODO
        public AccessToken Login(string userName, string password, string state)
        {
            var client = new RestClient(@"https://api.twitch.tv/kraken/oauth2/token");
            var request = new RestRequest(Method.POST);
            request.AddHeader("Content-type", "application/json");
            request.AddBody(
                new
                {
                    client_id = ClientID,
                    client_secret = ClientSecret,
                    grant_type = "authorization_code",
                    redirect = @"https://localhost",
                    code = /*code received from redirect*/,
                    state = state
                });

            var response = client.Execute(request);

            if (response.StatusCode == HttpStatusCode.OK)
            {
                var result = JsonConvert.DeserializeObject<AccessToken>(response.Content);
                return result;
            }
            return null;
        }
		public Task<string> Send(string method, string path, string json, CancellationToken cancelToken)
		{
			var request = new RestRequest(path, GetMethod(method));
            if (json != null)
			    request.AddParameter("application/json", json, ParameterType.RequestBody);
			return Send(request, cancelToken);
		}
Example #8
0
 private static RestRequest GetRequest(Method method, string resource)
 {
     var request = new RestRequest(method);
     request.Resource = resource;
     request.JsonSerializer = new RestSharpJsonNetSerializer();
     return request;
 }
Example #9
0
        private Task<dynamic> GetCore(dynamic parameters, CancellationToken ct)
        {
            return Task<dynamic>.Factory.StartNew(() => {

                this.RequiresAuthentication();

                var user = Context.CurrentUser as Identity;
                if (user == null)
                    return Negotiate.WithStatusCode(Nancy.HttpStatusCode.Unauthorized);

                List<string> responses = new List<string>();

                var client = new RestClient(Request.Url.SiteBase);
                foreach (var device in _connection.Select<Device>())
                {
                    var request = new RestRequest(DevicesProxyModule.PATH + "/.well-known/core", Method.GET);
                    request.AddUrlSegment("id", device.Id.ToString(CultureInfo.InvariantCulture));
                    request.AddParameter("SessionKey", user.Session.SessionKey);

                    var resp = client.Execute(request);

                    if (resp.StatusCode == HttpStatusCode.OK)
                        responses.Add(resp.Content);
                }

                var r = (Response)string.Join(",", responses);
                r.ContentType = "application/link-format";
                return r;
            }, ct);
        }
        public ActionResult FacebookAuth()
        {
            if (Request.Params.AllKeys.Contains("code"))
            {
                var code = Request.Params["code"];
                var client = new RestClient("https://graph.facebook.com/oauth/access_token");
                var request = new RestRequest(Method.GET);

                //request.AddParameter("action", "access_token");
                request.AddParameter("client_id", this.ClientID);
                request.AddParameter("redirect_uri", this.FacebookCallbackUrl);
                request.AddParameter("client_secret", this.ClientSecret);
                request.AddParameter("code", code);

                var response = client.Execute(request);

                var pairResponse = response.Content.Split('&');
                var accessToken = pairResponse[0].Split('=')[1];

                client = new RestClient("https://graph.facebook.com/me");
                request = new RestRequest(Method.GET);

                request.AddParameter("access_token", accessToken);

                response = client.Execute(request);

                JObject jObject = JObject.Parse(response.Content);
            }

            return RedirectToAction("Index", "Home");
        }
Example #11
0
        /// <summary>
        /// Confirm a newly-created subscription, pre-authorzation or one-off
        /// payment. This method also checks that the resource response data includes
        /// a valid signature and will throw a {SignatureException} if the signature is
        /// invalid.
        /// </summary>
        /// <param name="requestContent">the response parameters returned by the API server</param>
        /// <returns>the confirmed resource object</returns>
        public ConfirmResource ConfirmResource(NameValueCollection requestContent)
        {
            var resource = DeserializeAndValidateRequestSignature(requestContent);

            var request = new RestRequest("confirm", Method.POST);
            request.RequestFormat = DataFormat.Json;
            request.AddBody(
                new
                    {
                        resource_id = resource.ResourceId,
                        resource_type = resource.ResourceType
                    });

            var client = new RestClient
                             {
                                 BaseUrl = new System.Uri(ApiClient.ApiUrl),
                                 UserAgent = GoCardless.UserAgent
                             };
            var serializer = new JsonSerializer
            {
                ContractResolver = new UnderscoreToCamelCasePropertyResolver(),
            };
            client.AddHandler("application/json", new NewtonsoftJsonDeserializer(serializer));
            client.Authenticator = new HttpBasicAuthenticator(GoCardless.AccountDetails.AppId, GoCardless.AccountDetails.AppSecret);
            var response = client.Execute(request);
            if (response.StatusCode != HttpStatusCode.OK)
            {
                throw new ApiException("Unexpected response : " + (int)response.StatusCode + " " + response.StatusCode);
            }

            return resource;
        }
Example #12
0
        /// <summary>
        /// Get a listing of all event types that are available for webhooks.
        /// </summary>
        /// <returns>A list of event types and descriptions</returns>
        public List<WebhookEvents> GetWebhookEvents()
        {
            var request = new RestRequest();
            request.Resource = "/{accountId}/webhooks/events";

            return Execute<List<WebhookEvents>>(request);
        }
Example #13
0
        protected void btnCrear_Click(object sender, EventArgs e)
        {
            if (validarCampos())
            {
                RestClient client = new RestClient(ConfigurationManager.AppSettings.Get("endpoint"));
                RestRequest request = new RestRequest("kpis/", Method.POST);

                List<DetalleFormula> formulaCompleta = new List<DetalleFormula>();

                for (int i = 0; i < formula.Count; i++)
                {
                    formulaCompleta.Add(new DetalleFormula(i, variables[i], formula[i]));
                }

                KPI kpiNuevo = new KPI(0, txtDescripcion.Text, ddlFormato.Text, Convert.ToDouble(txtObjetivo.Text), ddlPeriodicidad.Text, new ParametroKPI(Convert.ToInt32(ddlLimiteInf.Text), Convert.ToInt32(ddlLimiteSup.Text)), formulaCompleta);

                request.AddJsonBody(kpiNuevo);

                var response = client.Execute(request);

                formula = new List<string>();
                variables = new List<string>();
                operador = false;

                Response.Redirect("indicadoresKPI.aspx");
            }
            else
            {
                //"error"
            }
        }
Example #14
0
        /// <summary>
        /// Delete all webhooks registered for an account.
        /// </summary>
        /// <returns>True if the webhook deleted successfully.</returns>
        public bool DeleteAllWebhooks()
        {
            var request = new RestRequest(Method.DELETE);
            request.Resource = "/{accountId}/webhooks";

            return Execute<bool>(request);
        }
 public bool CheckCredentials(string email, string password)
 {
     var request = new RestRequest("api/User/CheckCredentials?email={email}&password={password}", Method.GET);
     request.AddUrlSegment("email", email);
     request.AddUrlSegment("password", password);
     return client.Execute<bool>(request).Data;
 }
        public Project FindProject(string username, string projectName)
        {
            var gitHubApi = new GitHubApi(username, projectName);
            var request = new RestRequest(@"repos/{username}/{repository}");
            try
            {
                var responseData = gitHubApi.Execute<GitHubRepo>(request);

                string masterBranch = "master";
                if (!string.IsNullOrEmpty(responseData.Master_Branch))
                {
                    masterBranch = responseData.Master_Branch;
                }

                return new Project
                {
                     Name = responseData.Full_Name,
                     DownloadPackageUrl = new Uri(string.Format(@"https://github.com/{0}/{1}/zipball/{2}", username, projectName, masterBranch)),
                     LastModified = DateTime.UtcNow,
                     Description = responseData.Description
                };
            }
            catch (Exception ex)
            {
                this.logger.Error(ex, "An error has occured when finding project {0}/{1}", username, projectName);
                return null;
            }
        }
 protected RestRequest BuildPostRequest()
 {
     var request = new RestRequest(Method.POST);
     request.AddHeader("X-TrackerToken", m_token.Guid.ToString("N"));
     request.RequestFormat = DataFormat.Xml;
     return request;
 }
Example #18
0
        public IRestResponse<MarketplaceSearchResponse> Search(string query = "", int start = 0, int count = 10)
        {
            var client = new MarketplaceClient(BaseUrl);

            var request = new RestRequest("/", Method.GET);
            request.AddHeader("Accept", "*/*");
            request.AddHeader("Accept-Enclding", "gzip,deflat,sdch");
            request.AddHeader("Cache-Control", "no-cache");
            request.AddHeader("HOST", "steamcommunity.com");

            request.AddCookie("__ngDebug", "false");
            request.AddCookie("Steam_Language", "english");
            request.AddCookie("sessionid", "MTE3OTk1OTgyNQ");
            request.AddCookie("steamCC_67_167_177_70", "US");
            request.AddCookie("__utma", "268881843.805413192.1378770011.1382167972.1382171160.10");
            request.AddCookie("__utmb", "268881843.1.10.1382171160");
            request.AddCookie("__utmc", "268881843");
            request.AddCookie("__utmz", "268881843.1382171160.10.6.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)");
            //request.AddCookie("timezoneOffset", "-14400,0");

            //request.Timeout = 5*1000;
            request.AddHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36");

            request.AddParameter("query", query, ParameterType.GetOrPost);
            request.AddParameter("start", start, ParameterType.GetOrPost);
            request.AddParameter("count", count, ParameterType.GetOrPost);

            var response = client.Get<MarketplaceSearchResponse>(request);

            return response;
        }
        static private async Task<Images> download(string domain, string path, string pattern)
        {
            var result = new Images();
            var client = new RestClient(domain);
            var restTasks = new List<Task<IRestResponse>>();
            var response = client.Get(new RestRequest(path, Method.GET));

            foreach (Match match in Regex.Matches(response.Content, pattern))
            {
                string fileName = match.Captures[0].Value.Replace(">", "");
                result.Add(fileName, 0);
                if (!File.Exists(baseDir(path) + "\\" + fileName))
                {
                    var img = new RestRequest(path + fileName, Method.GET);
                    img.AddParameter("fileName", fileName);
                    restTasks.Add(client.ExecuteTaskAsync(img));
                }
            }

            foreach (var restTask in restTasks)
            {
                response = await restTask;
                string fileName = response.Request.Parameters[0].Value.ToString();
                result[fileName] = (int)response.StatusCode;
                if (response.StatusCode == HttpStatusCode.OK)
                {
                    var fs = File.Create(baseDir(path) + "\\" + fileName);
                    await fs.WriteAsync(response.RawBytes, 0, response.RawBytes.Length);
                    fs.Close();
                }
            }
            return result;
        }
        public bool Create(LocalRepositoryConfiguration config)
        {
            var request = new RestRequest(REPOSITORIES + "/" + config.key, Method.PUT);

            bool response = _client.Execute<LocalRepositoryConfiguration>(request, config);
            return response;
        }
 /// <summary>
 /// Returns a filtered list of Messages. The list includes paging information.
 /// Makes a GET request to the Messages List resource.
 /// </summary>
 /// <param name="options">The list filters for the request</param>
 public virtual void ListMessages(MessageListRequest options, Action<MessageResult> callback)
 {
     var request = new RestRequest();
     request.Resource = "Accounts/{AccountSid}/Messages.json";
     AddMessageListOptions(options, request);
     ExecuteAsync<MessageResult>(request, (response) => callback(response));
 }
Example #22
0
        static void callPhone(string phonenumber, string message)
        {
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(
                delegate
                {
                    return true;
                });

            var client = new RestClient("https://api.shoutpoint.com");
            var request = new RestRequest("v0/Dials/Connect", Method.POST);
            request.AddHeader("x-api-key", "SncRoqW8Lf4B4xA0nv5MH9tzKHnPfraA");
            request.AddHeader("Content-Type", "application/json");
            request.AddParameter("application/json", "{\"call\":{\"no\":" + phonenumber + ",\"caller_id_no\":\"17607183780\"}}", ParameterType.RequestBody);//16024784411
            var responce = client.Execute(request);//19492465047
            Console.WriteLine(responce);
            callobj test = JsonConvert.DeserializeObject<callobj>(responce.Content);
            var request2 = new RestRequest("v0/LiveCalls/" + test.call.id + "/Actions/HangUp", Method.POST);
            request2.AddHeader("x-api-key", "SncRoqW8Lf4B4xA0nv5MH9tzKHnPfraA");
            request2.AddHeader("Content-Type", "application/json");
            request2.AddParameter("application/json", "{\"message\":[\"" + message + "\"]}", ParameterType.RequestBody);
            var responce2 = client.Execute(request2);
            //var endcall= new RestRequest("v0/Dials/Connect", Method.POST);
            //endcall.AddHeader("x-api-key", "SncRoqW8Lf4B4xA0nv5MH9tzKHnPfraA");
            //endcall.AddHeader("Content-Type", "application/json");
        }
        /// <summary>
        /// Authorizes app via twitch.tv. If successful redirect is generated and code is parsed
        /// </summary>
        /// <returns></returns>
        public Code authorization()
        {
            {
                var client = new RestClient(@"https://api.twitch.tv/kraken/oauth2/authorize");
                var request = new RestRequest(Method.GET);

                request.AddParameter("response_type", "code");
                request.AddParameter("client_id", ClientID);
                request.AddParameter("redirect_url", @"https://localhost");
                request.AddParameter("scope", "chat_login");
                request.AddParameter("state", state);

                var response = client.Execute(request);

                if (response.StatusCode == HttpStatusCode.OK)
                {
                    //somehow grab redirect and parse code...

                }
                else
                {
                    return null;
                }
            }
        }
        public void BreakItemRoleInheritance(string listTitle, string baseSiteUrl, string user, string password, string domain)
        {
            try
            {
                RestClient RC = new RestClient(baseSiteUrl);
                NetworkCredential NCredential = new NetworkCredential(user, password, domain);
                RC.Authenticator = new NtlmAuthenticator(NCredential);

                RestRequest Request = new RestRequest("contextinfo?$select=FormDigestValue", Method.POST);
                Request.AddHeader("Accept", "application/json;odata=verbose");
                Request.AddHeader("Body", "");

                string ReturnedStr = RC.Execute(Request).Content;
                int StartPos = ReturnedStr.IndexOf("FormDigestValue") + 18;
                int length = ReturnedStr.IndexOf(@""",", StartPos) - StartPos;
                string FormDigestValue = ReturnedStr.Substring(StartPos, length);

                Request = new RestRequest("web/lists/GetByTitle('" + listTitle + "')/getItemById(12)/breakroleinheritance", Method.POST);
              //  Request = new RestRequest("web/lists/GetByTitle('" + listTitle + "')/breakroleinheritance(true)", Method.POST);
                Request.RequestFormat = DataFormat.Json;
                Request.AddHeader("Accept", "application/json;odata=verbose");
                Request.AddHeader("X-RequestDigest", FormDigestValue);
                string content = RC.Execute(Request).Content;

                //return "Permission breaked successfully";
            }
            catch (Exception)
            {

                throw;
            }
        }
        private void cargarKPIsAsignados()
        {
            RestClient client = new RestClient(ConfigurationManager.AppSettings.Get("endpoint"));
            RestRequest request = new RestRequest("kpis/indicadoresAsignados/{idRol}", Method.GET);

            request.AddUrlSegment("idRol", (string)Session["idRolSeleccionado"]);

            var response = client.Execute(request);

            string json = response.Content;

            List<KPI> listaKpis = JsonConvert.DeserializeObject<List<KPI>>(json);

            if (listaKpis != null)
            {
                DataTable tablaIndicadoresKPIAsignados = new DataTable("kpis");
                tablaIndicadoresKPIAsignados.Columns.AddRange(new DataColumn[5] {new DataColumn("ID",typeof(int)),
                new DataColumn("Descripcion",typeof(string)),
                new DataColumn("Formato",typeof(string)),
                new DataColumn("Objetivo",typeof(string)),
                new DataColumn("Periodicidad",typeof(string))
                });
                if (listaKpis.Count > 0)
                    foreach (var kpi in listaKpis)
                        tablaIndicadoresKPIAsignados.Rows.Add(kpi.KPIID, kpi.DescKpi, kpi.Formato, kpi.Objetivo, kpi.Periodicidad);

                Session["indicadoresKPIAsignados"] = tablaIndicadoresKPIAsignados;
                bindData(false);
            }
        }
        /// <summary>Creates new card registration data.</summary>
        /// <param name="cardRegistration">Card registration data object to create.</param>
        /// <returns>Card registration object returned from API.</returns>
        public CardRegistrationDataDTO RegisterCardData(CardRegistrationDataPostDTO cardRegistrationData)
        {
            var client = new RestClient(cardRegistrationData.CardRegistrationURL);

            var request = new RestRequest(Method.POST);
            request.AddParameter(Constants.DATA, cardRegistrationData.PreregistrationData);
            request.AddParameter(Constants.ACCESS_KEY_REF, cardRegistrationData.AccessKey);
            request.AddParameter(Constants.CARD_NUMBER, cardRegistrationData.CardNumber);
            request.AddParameter(Constants.CARD_EXPIRATION_DATE, cardRegistrationData.CardExpirationDate);
            request.AddParameter(Constants.CARD_CVX, cardRegistrationData.CardCvx);

            var response = client.Execute(request);

            var responseString = response.Content;

            if (response.StatusCode == HttpStatusCode.OK)
            {
                var cardRegistrationDataDTO = new CardRegistrationDataDTO
                {
                    RegistrationData = responseString
                };
                return cardRegistrationDataDTO;
            }
            else
                throw new Exception(responseString);
        }
        /// <summary>
        /// This example uses the raw JSON string to create a POST
        /// request for sending one or more SMTP messages through Email-On-Demand.
        /// 
        /// The JSON request generated by this sample code looks like this:
        /// 
        ///{
        ///    "ServerId": "YOUR SERVER ID HERE",
        ///    "ApiKey": "YOUR API KEY HERE",
        ///    "Messages": [{
        ///        "Subject": "Email subject line for raw JSON example.",
        ///        "TextBody": "The text portion of the message.",
        ///        "HtmlBody": "<h1>The html portion of the message</h1><br/>Test",
        ///        "To": [{
        ///            "EmailAddress": "[email protected]",
        ///            "FriendlyName": "Customer Name"
        ///        }],
        ///        "From": {
        ///            "EmailAddress": "[email protected]",
        ///            "FriendlyName": "From Address"
        ///        },
        ///    }]
        ///}
        /// </summary>
        public static void SimpleInjectionViaStringAsJson(
            int serverId, string yourApiKey, string apiUrl)
        {
            // The client object processes requests to the SocketLabs Injection API.
            var client = new RestClient(apiUrl);

            // Construct the string used to generate JSON for the POST request.
            string stringBody =
                "{" +
                    "\"ServerId\":\"" + serverId + "\"," +
                    "\"ApiKey\":\"" + yourApiKey + "\"," +
                    "\"Messages\":[{" +
                        "\"Subject\":\"Email subject line for raw JSON example.\"," +
                        "\"TextBody\":\"The text portion of the message.\"," +
                        "\"HtmlBody\":\"<h1>The html portion of the message</h1><br/>Test\"," +
                        "\"To\":[{" +
                            "\"EmailAddress\":\"[email protected]\"," +
                            "\"FriendlyName\":\"Customer Name\"" +
                        "}]," +
                        "\"From\":{" +
                            "\"EmailAddress\":\"[email protected]\"," +
                            "\"FriendlyName\":\"From Address\"" +
                        "}," +
                    "}]" +
                "}";

            try
            {
                // Generate a new POST request.
                var request = new RestRequest(Method.POST) { RequestFormat = DataFormat.Json };

                // Store the request data in the request object.
                request.AddParameter("application/json; charset=utf-8", stringBody, ParameterType.RequestBody);

                // Make the POST request.
                var result = client.ExecuteAsPost(request, "POST");

                // Store the response result in our custom class.
                using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(result.Content)))
                {
                    var serializer = new DataContractJsonSerializer(typeof (PostResponse));
                    var resp = (PostResponse) serializer.ReadObject(stream);

                    // Display the results.
                    if (resp.ErrorCode.Equals("Success"))
                    {
                        Console.WriteLine("Successful injection!");
                    }
                    else
                    {
                        Console.WriteLine("Failed injection! Returned JSON is: ");
                        Console.WriteLine(result.Content);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error, something bad happened: " + ex.Message);
            }
        }
 public void GetPersons(Action<List<Person>> callback)
 {
     var client = new RestClient("https://raw.github.com/bekkopen/dotnetkurs/master/PersonPhoneApp/");
     client.AddHandler("text/plain", new JsonDeserializer());
     var request = new RestRequest("Persons.json", Method.GET) {RequestFormat = DataFormat.Json};
     client.ExecuteAsync<List<Person>>(request, response => callback(response.Data));
 }
		public IEnumerable<Application> GetApplications()
		{
			var request = new RestRequest();
			request.Resource = "applications";

			return ExecuteGet<List<Application>>(request);
		}
 private static string FetchFeed(string domain, string resource)
 {
     var client = new RestClient(domain);
     var request = new RestRequest(resource);
     IRestResponse response = client.Execute(request);
     return response.Content;
 }