-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
In
https://stackoverflow.com/questions/6180162/echo-curl-request-header-body-without-sending-it and
https://stackoverflow.com/a/47694977/1118719
https://stackoverflow.com/a/36016711/1118719
we see users needing to make connections (even if just to localhost) to see what curl is actually sending. Imagine that, the only way to see what I am about to send is to send something. But then I already sent it. (OK, first 'send it into some sort of condom', and then examine what is in that condom. But must it be that way?)
But one day one might only get only one chance to send exactly the right
request(s) to a certain site. Any mistakes might make the difference of
downloading the Pentagon Papers vs. getting the authorities knocking
on one's door. (And no, "Just adjust the site name when you are finally
happy with the condom's contents" doesn't give one full confidence.)
That's why curl needs simple concepts like:
WWW::Mechanize::Cookbook(3pm)
See what will be sent without actually sending anything
$mech->add_handler("request_send", sub { shift->dump; exit; });
$mech->get("http://www.example.com");
(in the same spirit of:)
apt-get --print-uris --simulate --just-print --dry-run --no-act
and
rsync --dry-run #but alas no --just-print, --print-uris
Well, at least add it to https://curl.haxx.se/docs/todo.html . Thanks.