• 2024-05-21.net 4.8 webApi 文件下载部分代码记录
    privateHttpResponseMessageExportData(stringids,Func<string,string>exportFunc,stringdataNotExistsMsg){varfilePath=exportFunc.Invoke(ids);//检查文件是否存在if(!File.Exists(filePath)){
  • 2023-05-29netcore-http
    https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/http-requests?view=aspnetcore-6.0 //Addservicestothecontainer.builder.Services.AddHttpClient();publicclassBasicModel:PageModel{privatereadonlyIHttpClientFactory_httpClient
  • 2023-03-23.NET & Nsubstitute 模拟Http请求
    我们的代码中有时候会需要调用其他平台的接口,在做单元测试的时候,我们不需要测试这些第三方接口是否生效,接口是否有问题,但是如果我们直接调用第三方接口,这些接口的错误又会影
  • 2023-03-20C# - 文件下载API接口实现
    ///<summary>///下载文件///</summary>///<paramname="id">文件ID</param>///<returns>返回文件下载链接</returns>[Http
  • 2023-02-01HttpClient 正确使用方法
    如何正确模拟 Http请求,建议使用HttpClient 错误用法   varhttpClient=newHttpClient(); 正确用法ServiceCollection.AddHttpClient();publicc
  • 2022-11-02死锁【3】
    api接口无响应,呈现了hangon现象,从一些过往经验看,大概也只有三种情况。大量锁等待线程不够用死锁有了这种先入为主的思想,那就上windbg说事呗。windbg分析1.