예제 #1
0
        public string Delete(string uri)
        {
            using (var cl = new RESTRoutinen(Settings.Url))
            {
                try
                {
                    if (AuthToken != null)
                    {
                        cl.AdditionalHeaders.Add("X-Gdl-AuthToken: " + AuthToken.Token);
                    }

                    return(cl.Delete(uri));
                }
                catch (WebException ex)
                {
                    ApiException exception = TranslateException(ex);
                    if (!IgnoreOnErrorOccured)
                    {
                        OnErrorOccured(new ApiErrorArgs(exception.Message, exception.StatusCode));
                    }

                    throw exception;
                }
            }
        }
예제 #2
0
        public T Delete <T>(string uri, object data, JsonSerializerSettings settings = null)
        {
            using (var cl = new RESTRoutinen(Settings.Url))
            {
                try
                {
                    if (AuthToken != null)
                    {
                        cl.AdditionalHeaders.Add("X-Gdl-AuthToken: " + AuthToken.Token);
                    }

                    return(cl.Delete <T>(uri, data, settings));
                }
                catch (WebException ex)
                {
                    ApiException exception = TranslateException(ex, data);
                    if (!IgnoreOnErrorOccured)
                    {
                        OnErrorOccured(new ApiErrorArgs(exception.Message, exception.StatusCode));
                    }

                    throw exception;
                }
            }
        }