We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17c93e7 commit 7aebb1bCopy full SHA for 7aebb1b
README.md
@@ -311,6 +311,23 @@ public interface IUserApi
311
`Task<byte[]>` | 原始响应二进制数据
312
`Task<string>` | 原始响应消息文本
313
314
+### 文件下载
315
+```
316
+public interface IUserApi
317
+{
318
+ [HttpGet("/files/{fileName}"]
319
+ Task<HttpResponseMessage> DownloadAsync(string fileName);
320
+}
321
322
+
323
324
+using System.Net.Http
325
326
+var response = await userApi.DownloadAsync('123.zip');
327
+using var fileStream = File.OpenWrite("123.zip");
328
+await response.SaveAsAsync(fileStream);
329
330
331
### 接口声明示例
332
#### Petstore接口
333
这个OpenApi文档在[petstore.swagger.io](https://petstore.swagger.io/),代码为使用WebApiClientCore.OpenApi.SourceGenerator工具将其OpenApi文档反向生成得到
0 commit comments