protected string Post <TRequest>(TRequest request) where TRequest : APIRequestBodyBase <TRequest> { var result = _handler.Handle(() => { return(_restfulClient.DoPost(request.Url, request.ContentType, request.Headers, request.ToString(), request.SecurityProtocol, request.TimeOut, request.UseSecurity)); }); return(result); }
protected TResponse Post <TRequest, TResponse>(TRequest request) where TRequest : APIRequestBodyBase <TRequest> where TResponse : APIResponseBodyBase <TResponse> { _log.DebugFormat("Request:{0}", request.ToString()); var result = _handler.Handle(() => { _restfulClient = _restfulClient ?? new RestfulClient(); return(_restfulClient.DoPost(request.Url, request.ContentType, request.Headers, request.ToString(), request.SecurityProtocol, request.TimeOut, request.UseSecurity)); }); _log.DebugFormat("Response:{0}", result); var response = APIResponseBodyBase <TResponse> .Deserialize(result); return(response); }