/// <summary> /// 添加参数 /// </summary> /// <param name="request">请求</param> /// <param name="method">请求方法</param> /// <param name="paramObj">条件</param> protected void RestRequestWithParam(IRestRequest request, Method method, object paramObj) { if (paramObj != null) { switch (method) { case Method.GET: request.AddGetObject(paramObj); break; case Method.POST: request.AddJsonBody(paramObj); break; case Method.PUT: request.AddJsonBody(paramObj); break; case Method.DELETE: request.AddJsonBody(paramObj); break; default: request.AddObject(paramObj); break; } } }