#!/usr/bin/perl -- use strict; use warnings; use LWP; sub LWP::Protocol::http::SocketMethods::format_request { package LWP::Protocol::http::SocketMethods; my( $socket, $method, $fullpath, @h ) = @_; my $req_buf = $socket->Net::HTTP::Methods::format_request($method, + $fullpath, @h); Data::Dump::dd( $req_buf ); return $req_buf; } LWP::UserAgent->new->get( q{http://example.com/} )->dump; __END__ "GET / HTTP/1.1\r\nTE: deflate,gzip;q=0.3\r\nConnection: TE, close\r\n +Host: example.com\r\nUser-Agent: libwww-perl/6.05\r\n\r\n" HTTP/1.1 200 OK Cache-Control: max-age=604800 Connection: close Date: Sat, 24 May 2014 19:06:51 GMT Accept-Ranges: bytes ETag: "359670651" Server: ECS (sjc/4FCE) Content-Length: 1270 Content-Type: text/html Expires: Sat, 31 May 2014 19:06:51 GMT Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT Client-Date: Sat, 24 May 2014 19:13:24 GMT Client-Peer: 93.184.216.119:80 Client-Response-Num: 1 Title: Example Domain X-Cache: HIT X-Ec-Custom-Error: 1 X-Meta-Charset: utf-8 X-Meta-Viewport: width=device-width, initial-scale=1 ...
In reply to Re: LWP is there any way to get "real" outgoing headers?
by Anonymous Monk
in thread LWP is there any way to get "real" outgoing headers?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |