1HEAD(1)               User Contributed Perl Documentation              HEAD(1)
2
3
4

NAME

6       lwp-request - Simple command line user agent
7

SYNOPSIS

9        lwp-request [-aeEdvhx] [-m method] [-b <base URL>] [-t <timeout>]
10                    [-i <if-modified-since>] [-c <content-type>] [-C <credentials>]
11                    [-p <proxy-url>] [-o <format>] <url>...
12

DESCRIPTION

14       This program can be used to send requests to WWW servers and your local
15       file system. The request content for POST and PUT methods is read from
16       stdin.  The content of the response is printed on stdout.  Error mes‐
17       sages are printed on stderr.  The program returns a status value indi‐
18       cating the number of URLs that failed.
19
20       The options are:
21
22       -m <method>
23           Set which method to use for the request.  If this option is not
24           used, then the method is derived from the name of the program.
25
26       -f  Force request through, even if the program believes that the method
27           is illegal.  The server might reject the request eventually.
28
29       -b <uri>
30           This URI will be used as the base URI for resolving all relative
31           URIs given as argument.
32
33       -t <timeout>
34           Set the timeout value for the requests.  The timeout is the amount
35           of time that the program will wait for a response from the remote
36           server before it fails.  The default unit for the timeout value is
37           seconds.  You might append "m" or "h" to the timeout value to make
38           it minutes or hours, respectively.  The default timeout is '3m',
39           i.e. 3 minutes.
40
41       -i <time>
42           Set the If-Modified-Since header in the request. If time is the
43           name of a file, use the modification timestamp for this file. If
44           time is not a file, it is parsed as a literal date. Take a look at
45           HTTP::Date for recognized formats.
46
47       -c <content-type>
48           Set the Content-Type for the request.  This option is only allowed
49           for requests that take a content, i.e. POST and PUT.  You can force
50           methods to take content by using the "-f" option together with
51           "-c".  The default Content-Type for POST is "applica‐
52           tion/x-www-form-urlencoded".  The default Content-type for the oth‐
53           ers is "text/plain".
54
55       -p <proxy-url>
56           Set the proxy to be used for the requests.  The program also loads
57           proxy settings from the environment.  You can disable this with the
58           "-P" option.
59
60       -H <header>
61           Send this HTTP header with each request. You can specify several,
62           e.g.:
63
64               lwp-request \
65                   -H 'Referer: http://other.url/' \
66                   -H 'Host: somehost' \
67                   http://this.url/
68
69       -C <username>:<password>
70           Provide credentials for documents that are protected by Basic
71           Authentication.  If the document is protected and you did not spec‐
72           ify the username and password with this option, then you will be
73           prompted to provide these values.
74
75       The following options controls what is displayed by the program:
76
77       -u  Print request method and absolute URL as requests are made.
78
79       -U  Print request headers in addition to request method and absolute
80           URL.
81
82       -s  Print response status code.  This option is always on for HEAD
83           requests.
84
85       -S  Print response status chain. This shows redirect and authorization
86           requests that are handled by the library.
87
88       -e  Print response headers.  This option is always on for HEAD
89           requests.
90
91       -d  Do not print the content of the response.
92
93       -o <format>
94           Process HTML content in various ways before printing it.  If the
95           content type of the response is not HTML, then this option has no
96           effect.  The legal format values are; text, ps, links, html and
97           dump.
98
99           If you specify the text format then the HTML will be formatted as
100           plain latin1 text.  If you specify the ps format then it will be
101           formatted as Postscript.
102
103           The links format will output all links found in the HTML document.
104           Relative links will be expanded to absolute ones.
105
106           The html format will reformat the HTML code and the dump format
107           will just dump the HTML syntax tree.
108
109           Note that the "HTML-Tree" distribution needs to be installed for
110           this option to work.  In addition the "HTML-Format" distribution
111           needs to be installed for -o text or -o ps to work.
112
113       -v  Print the version number of the program and quit.
114
115       -h  Print usage message and quit.
116
117       -x  Extra debugging output.
118
119       -a  Set text(ascii) mode for content input and output.  If this option
120           is not used, content input and output is done in binary mode.
121
122       Because this program is implemented using the LWP library, it will only
123       support the protocols that LWP supports.
124

SEE ALSO

126       lwp-mirror, LWP
127
129       Copyright 1995-1999 Gisle Aas.
130
131       This library is free software; you can redistribute it and/or modify it
132       under the same terms as Perl itself.
133

AUTHOR

135       Gisle Aas <gisle@aas.no>
136
137
138
139perl v5.8.8                       2006-07-12                           HEAD(1)
Impressum