Ejemplo n.º 1
0
        /// <summary>
        /// 执行指定方法的请求,将返回内容保存在指定路径的文件中
        /// </summary>
        /// <param name="filePath">包含文件名的路径</param>
        /// <param name="method">http Method</param>
        /// <returns></returns>
        public long ExecuteForFile(string filePath, Method method)
        {
            var  stream = ExecutForStream(method);
            long total  = _response.ContentLength;

            return(EasyHttpUtils.ReadAllAsFile(stream, total, filePath));
        }