直接获取vb.net中第一个n个字符之后的内容
在 VB.NET 中使用 GET 或 POST 向 HTTPS 页面发送 HTTP 请求后,有什么方法可以直接说出前 5000 个字符之后的 1000 个字符,跳过之前的所有内容?
我问这个问题的原因是因为在我尝试通过我的程序的一个网页中,该网站正在分块发送响应数据,第一个块包含一些我不感兴趣的 JavaScript 垃圾,这是我唯一的数据关心的是第二个块,
我不知道如何在收到第一个块后获取第二个块,因为它位于同一个 HTTP 请求中
它将保存如果我可以跳过我不需要的第一个块,
这可能吗,还是我只是在做白日梦?
非常感谢!
额外: 以下是我从我试图获取的网页中获得的典型响应标头:
Date: Mon, 20 Jun 2011 13:21:56 GMT Set-Cookie: JSESSIONID=1AF1AF9EF936E1CB2FA85B750EDC67C4; Path=****some path******; Secure Content-Type: text/html; charset=ISO-8859-1 Transfer-Encoding: chunked Set-Cookie: **********some cookie*************** path=/ Vary: Accept-Encoding, User-Agent
不确定这是否有帮助,但正如您所看到的,块大小对我来说不可见,其中没有“预告片”标题也是如此。
Is there any way we could get directly say the 1000 characters after the first 5000 characters, skipping everything before that after sending in an HTTP request to an HTTPS page using either GET or POST in VB.NET?
The reason why I ask this question is because in one of the webpage I am trying the get through my program, the website is sending response data in chunks with the first chunk containing some javascript garbage that I have no interest in, the only data I care is in the second chunk and
I have no idea how to get the second chunk after receiving the first one since it is within the same HTTP request
It would save some time and Internet traffic if I can skip the first chunk that I do not need.
Is that possible or I am just day dreaming?
Many thanks!
ADDED:
Here is how a typical header of the response I am getting from the webpage I am trying to get:
Date: Mon, 20 Jun 2011 13:21:56 GMT Set-Cookie: JSESSIONID=1AF1AF9EF936E1CB2FA85B750EDC67C4; Path=****some path******; Secure Content-Type: text/html; charset=ISO-8859-1 Transfer-Encoding: chunked Set-Cookie: **********some cookie*************** path=/ Vary: Accept-Encoding, User-Agent
Not sure if that helps, but as you can see, the chunk size is not visible to me, there is no "Trailer" in the header as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有趣的小问题。查看以下 GET 请求中的 RANGE。
编辑:找到了一个 HTTP 示例。
这是一个 PHP 示例 。 (抱歉,我找不到任何 VB.NET 示例)。
Fun little problem. Look at RANGE in the following GET request.
Edit: Found a HTTP example.
Here is an example in PHP. (Sorry I couldn't find any VB.NET examples).