Example #1
0
        public string Delete(string path)
        {
            support.LogRequest("DELETE", path);

            byte[] responseBytes = HttpMethods.DeleteHttp(apiToken, path);
            string response      = Converter.ToString(responseBytes);

            support.LogResponse(response);

            return(response);
        }
        public void DeletePackage(PackageId id)
        {
            string path = template.UrlFor(UrlTemplate.PACKAGE_ID_PATH).Replace("{packageId}", id.Id).Build();

            try
            {
                HttpMethods.DeleteHttp(apiToken, path);
            }
            catch (Exception e)
            {
                throw new EslException("Could not delete package. Exception: " + e.Message);
            }
        }
        /// <summary>
        /// Deletes the document from the package.
        /// </summary>
        /// <param name="packageId">The package id.</param>
        /// <param name="document">The document to delete.</param>
        public void DeleteDocument(PackageId packageId, Document document)
        {
            string path = template.UrlFor(UrlTemplate.DOCUMENT_ID_PATH)
                          .Replace("{packageId}", packageId.Id)
                          .Replace("{documentId}", "document.Id")
                          .Build();

            try {
                HttpMethods.DeleteHttp(apiToken, path);
            } catch (Exception e) {
                throw new EslException("Could not delete document from package." + " Exception: " + e.Message);
            }
        }
Example #4
0
        public void Delete(string path, string jsonPayload, string sessionId)
        {
            support.LogRequest("DELETE", path);

            var payloadBytes = jsonPayload != null?Converter.ToBytes(jsonPayload) : new byte [0];

            if (proxyConfiguration != null)
            {
                HttpMethods.ProxyConfiguration = proxyConfiguration;
            }

            headerGen = new SessionIdAuthHeaderGenerator(sessionId);
            HttpMethods.DeleteHttp(headerGen, path, payloadBytes, SetupAuthorization(sessionId));
        }
Example #5
0
        public string Delete(string path)
        {
            support.LogRequest("DELETE", path);

            if (proxyConfiguration != null)
            {
                HttpMethods.proxyConfiguration = proxyConfiguration;
            }

            byte[] responseBytes = HttpMethods.DeleteHttp(apiToken, path, additionalHeaders);
            string response      = Converter.ToString(responseBytes);

            support.LogResponse(response);

            return(response);
        }
Example #6
0
        public string Delete(string path, string jsonPayload)
        {
            var payloadBytes = jsonPayload != null?Converter.ToBytes(jsonPayload) : new byte [0];

            if (proxyConfiguration != null)
            {
                HttpMethods.ProxyConfiguration = proxyConfiguration;
            }

            byte[] responseBytes = HttpMethods.DeleteHttp(apiKey, path, payloadBytes, SetupAuthorization(null));
            string response      = Converter.ToString(responseBytes);

            support.LogResponse(response);

            return(response);
        }
Example #7
0
        public string Delete(string path)
        {
            support.LogRequest("DELETE", path);

            if (proxyConfiguration != null)
            {
                HttpMethods.ProxyConfiguration = proxyConfiguration;
            }

            byte[] responseBytes = HttpMethods.DeleteHttp(apiKey, path, SetupAuthorization(null));
            string response      = Converter.ToString(responseBytes);

            support.LogResponse(response);

            return(response);
        }
Example #8
0
        public void Delete(string path, string jsonPayload, string sessionId)
        {
            support.LogRequest("DELETE", path);

            byte [] payloadBytes = null;
            if (jsonPayload != null)
            {
                payloadBytes = Converter.ToBytes(jsonPayload);
            }
            else
            {
                payloadBytes = new byte [0];
            }

            if (proxyConfiguration != null)
            {
                HttpMethods.proxyConfiguration = proxyConfiguration;
            }

            headerGen = new SessionIdAuthHeaderGenerator(sessionId);
            byte [] responseBytes = HttpMethods.DeleteHttp(headerGen, path, payloadBytes, additionalHeaders);
        }
Example #9
0
        public string Delete(string path, string jsonPayload)
        {
            byte [] payloadBytes = null;
            if (jsonPayload != null)
            {
                payloadBytes = Converter.ToBytes(jsonPayload);
            }
            else
            {
                payloadBytes = new byte [0];
            }

            if (proxyConfiguration != null)
            {
                HttpMethods.proxyConfiguration = proxyConfiguration;
            }

            byte [] responseBytes = HttpMethods.DeleteHttp(apiKey, path, payloadBytes, additionalHeaders);
            string  response      = Converter.ToString(responseBytes);

            support.LogResponse(response);

            return(response);
        }