C# 从字符串中解析 HTTP POST 响应对象的元素
我有一组文件,每个文件都包含一系列 HTTP POST 响应的全文。其中许多包含二进制对象(例如图像或 PDF)。我一直在尝试使用正则表达式来提取二进制对象,但我似乎无法正确获取它。 HTTPListener 类(和关联的类)似乎都需要活动连接,即解析实时请求响应对,而我没有。是否有一个好的库可以将文件(或字符串)解析为 HTTP 响应?如果没有,有人能想到比正则表达式更好的方法吗?
谢谢, 里克
I have a set of files, each of which contain the full text of a series of HTTP POST responses. A number of these contain binary objects (e.g. images or PDFs). I've been trying to use regexes to extract the binary objects, but I can't seem to get it correctly. The HTTPListener class (and associated classes) all seem to require an active connection, i.e. parsing a real time request response pair, which I don't have. Is there a good library out there which can parse a file (or a string) as an HTTP response? If not, can anyone think of a better method for doing this than regex?
Thanks,
Rik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以轻松编写自己的解析器,它执行以下操作:
问候
You can easily write your own Parser which does the following:
Regards