private static string GetString(string url, string accessToken) { using (var c = new WebClient()) { c.Headers[HttpRequestHeader.Authorization] = String.Format(SpApiConstants.RequestHeaders.AUTHORIZATIONTEMPLATE, accessToken); c.Headers[HttpRequestHeader.Accept] = SpApiConstants.RequestHeaders.JSON_CONTENT; try { var results = c.DownloadString(url); return(results); } catch (WebException exception) { var reason = ExceptionService.GetFailureReason(exception); throw ExceptionService.WebExceptionHandler(exception, reason); } } }