The gnu wget in spider mode shows "Length: 122 [text/html]" even without
-S. Actually the -S just shows headers.

BTW for a less code and more clearness instead of the spider option wget
may just send a HEAD request with --method=HEAD. In conjunction with recent
patch with -post-data this will allow to use wget to call any REST API


On Thu, Sep 30, 2021 at 18:38 Doug Clapp <[email protected]> wrote:

> I think what you get may depend on what version of BusyBox you are
> using. I check 3 different versions I happen to have. v1.24.0.git shows
> only "-s|--spider" and seems to give no output except its return code.
> v1.27.2 shows "--spider" as well as "-S|--server-response."
>
> Using v1.27.2,
> busybox wget -S --spider http://example.com/ 2>&1 | busybox awk
> '/Content-Length/{print $2}'
> yields 1256, which is what I think you want. I've never used sed that
> much but awk is a tool I use a lot; that's why I rewrote the one-liner
> that way. You may have to get a newer version of BusyBox.
>
> Doug Clapp
>
> _______________________________________________
> busybox mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/busybox
>
-- 
Sergey Ponomarev <https://linkedin.com/in/stokito>, skype:stokito
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to