问题描述
这是问题。
给定网址 http://www.example.com ,我们可以读取前N个字节通过使用 wget ,我们可以下载整个网页。 $ b $ b
使用 curl ,有-r,0-499指定前500个字节。似乎解决了这个问题。
使用 urlib 在python中。类似问题,但根据Konstantin的评论,是真的吗?
因此,问题是我们如何在实践中从HTTP服务器读取前N个字节?
感谢
curl< url& | head -c 499
或
curl< url> | dd count = 499
应该
也有更简单的工具可能borader可用性如
netcat host 80<HERE| dd count = 499 of = output.fragment
GET / urlpath / query?string = more& bloddy = stuff
此处
或
GET / urlpath / query?string = more& bloddy = stuff
Here is the question.
Given the url http://www.example.com, can we read the first N bytes out of the page?
- using wget, we can download the whole page.
using curl, there is -r, 0-499 specifies the first 500 bytes. Seems solve the problem.
using urlib in python. similar question here, but according to Konstantin's comment, is that really true?
So the problem is that how can we read the first N bytes from the HTTP server in practice?
Regards & Thanks
curl <url> | head -c 499
or
curl <url> | dd count=499
should do
Also there are simpler utils with perhaps borader availability like
netcat host 80 <<"HERE" | dd count=499 of=output.fragment
GET /urlpath/query?string=more&bloddy=stuff
HERE
Or
GET /urlpath/query?string=more&bloddy=stuff
这篇关于可以使用Linux命令从HTTP服务器只读取前N个字节吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!