private string GetUrl(RestRequest request, QueryParamList authParameters)
        {
            //if (request.HasData)
            //{
            //	return request.ApiHostWithEndpoint.ToString();
            //}

            return(string.Concat(request.ApiHostWithEndpoint, "?", authParameters.Concat()));
        }
        private HttpContent CreateContent(RestRequest request, QueryParamList authParameters)
        {
            if (request.Data == null)
            {
                var dataToSend = authParameters.Concat();

                var content = new ByteArrayContent(Encoding.UTF8.GetBytes(dataToSend));
                content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
                return(content);
            }
            else
            {
                var json    = _serializer.Serialize(request.Data);
                var content = new ByteArrayContent(Encoding.UTF8.GetBytes(json));
                content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
                return(content);
            }
        }
        public string GenerateSignature(RestRequest request, QueryParamList parameters)
        {
            if (request == null)
            {
                throw new ArgumentNullException("request");
            }
            var sb = new StringBuilder();

            sb.Append(Enum.GetName(typeof(RestMethod), request.Method).ToUpperInvariant());
            sb.Append("\n");
            sb.Append(request.ApiHost);
            sb.Append("\n");
            sb.Append("/" + request.EndpointName);
            sb.Append("\n");
            sb.Append(parameters.Concat());
            var toSign = sb.ToString();

            return(GetHmacSha256(toSign, request.SecretKey));
        }