private IRestRequest CreateRestRequest(string path, Method method, EzTextingModel model         = null,
                                               IEnumerable <KeyValuePair <string, object> > queryParams = null)
        {
            var request = new RestRequest
            {
                Method         = method,
                RequestFormat  = DataFormat.Json,
                JsonSerializer = _jsonSerializer
            };
            var authString       = _authentication.AsParamString();
            var requestPath      = new StringBuilder(path);
            var modelQueryParams = ClientUtils.BuildQueryParams(model);
            var extraQueryParams = new StringBuilder();

            if (queryParams != null)
            {
                foreach (var param in queryParams)
                {
                    extraQueryParams
                    .Append(param.Key)
                    .Append("=")
                    .Append(param.Value.ToString().UrlEncode())
                    .Append('&');
                }
            }

            if (method == Method.GET || method == Method.DELETE)
            {
                requestPath.Append('&').Append(authString);
                CombineParameters(requestPath, modelQueryParams.ToString(), extraQueryParams.ToString());
            }
            else if (method == Method.POST)
            {
                var postBody = new StringBuilder(authString);
                CombineParameters(postBody, modelQueryParams.ToString(), extraQueryParams.ToString());
                request.AddParameter(ClientConstants.FormEncodedContentType, postBody.ToString(),
                                     ClientConstants.FormEncodedContentType, ParameterType.RequestBody);
            }
            else
            {
                throw new EzTextingClientException("HTTP method " + method + " isn't supported.");
            }
            request.AddHeader("Accept", ClientConstants.JsonContentType);
            request.Resource = requestPath.ToString();

            return(request);
        }