如何根据 contentType 处理 webresponse
How to process the webresponse based on its contentType
我想根据内容类型处理响应。有没有比写 response.ContentType=="application/x-zipcompressed" 更好的方法。我的意思是我可以有 rar 或 zip。我想知道检查字符串是否是正确的解决方案。
您应该查看 "Chain of Responsibility" 模式。
https://www.codeproject.com/Articles/743783/Reusable-Chain-of-responsibility-in-Csharp
我想根据内容类型处理响应。有没有比写 response.ContentType=="application/x-zipcompressed" 更好的方法。我的意思是我可以有 rar 或 zip。我想知道检查字符串是否是正确的解决方案。
您应该查看 "Chain of Responsibility" 模式。
https://www.codeproject.com/Articles/743783/Reusable-Chain-of-responsibility-in-Csharp