private ApiResponse PerformRequest(HttpVerb verb, string action, object vm = null)
        {
            CheckAccessToken();

            HttpWebRequest request = WebRequestHelper.CreateRequest(verb, action);
            RequestContent content = vm != null
                ? new RequestContent(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(vm)), ContentFormat.Json)
                : null;
            ApiResponse response = WebRequestHelper.GetTypedResponse <ApiResponse>(request, content);

            ThrowExceptionIfError(response.Result);

            return(response);
        }
Esempio n. 2
0
 public IssueManagerClientBase(string host, string storedAccessToken = null)
 {
     WebRequestHelper = new WebRequestHelper(host, storedAccessToken);
 }