Exemplo n.º 1
0
 private void fill_params(ref RestRequest req, RequestBodyParams args)
 {
     if (args == null)
     {
         return;
     }
     foreach (var arg in args)
     {
         req.AddParameter(arg.Key, arg.Value);
     }
 }
Exemplo n.º 2
0
        public response.BaseResponse <T> patch <T>(string endpoint, RequestBodyParams args = null, bool isbodyjson = true)
        {
            var req = new RestRequest(endpoint, Method.PATCH);

            fill_body_params(ref req, args, isbodyjson);

            IRestResponse resp = client.Execute(req);

            check_response(resp);

            return(deserializeResponse <T>(resp.Content));
        }
Exemplo n.º 3
0
 private void fill_body_params(ref RestRequest req, RequestBodyParams bodyp, bool isJson = true)
 {
     if (bodyp == null)
     {
         return;
     }
     if (!isJson)
     {
         fill_params(ref req, args: bodyp);
         return;
     }
     req.AddJsonBody(bodyp);
 }