Beispiel #1
0
 public string Build(string command, RestRequestBuilder request = null)
 {
     if (request != null)
     {
         return($"{_host}{_path}{_wallet}{command}?{request.BuildParams()}");
     }
     else
     {
         return($"{_host}{_path}{_wallet}{command}");
     }
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="request">The initial object</param>
        public RestRequestBuilder(RestRequestBuilder request = null)
        {
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

            if (request != null)
            {
                _params = new Dictionary <string, string>(request._params);
            }
            else
            {
                _params = new Dictionary <string, string>();
            }
        }
        /// <summary>
        /// Add and merge another object
        /// </summary>
        /// <param name="request">The object that want to add</param>
        /// <returns>Current object</returns>
        public RestRequestBuilder AddParam(RestRequestBuilder request)
        {
            _params.Concat(request._params);

            return(this);
        }