1GET(1) User Contributed Perl Documentation GET(1)
2
3
4
6 lwp-request, GET, POST, HEAD - Simple command line user agent
7
9 lwp-request [-afPuUsSedvhx] [-m method] [-b base URL] [-t timeout]
10 [-i if-modified-since] [-c content-type]
11 [-C credentials] [-p proxy-url] [-o format] url...
12
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
17 messages are printed on stderr. The program returns a status value
18 indicating 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
52 "application/x-www-form-urlencoded". The default Content-type for
53 the others 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 -P Don't load proxy settings from environment.
61
62 -H <header>
63 Send this HTTP header with each request. You can specify several,
64 e.g.:
65
66 lwp-request \
67 -H 'Referer: http://other.url/' \
68 -H 'Host: somehost' \
69 http://this.url/
70
71 -C <username>:<password>
72 Provide credentials for documents that are protected by Basic
73 Authentication. If the document is protected and you did not
74 specify the username and password with this option, then you will
75 be prompted to provide these values.
76
77 The following options controls what is displayed by the program:
78
79 -u Print request method and absolute URL as requests are made.
80
81 -U Print request headers in addition to request method and absolute
82 URL.
83
84 -s Print response status code. This option is always on for HEAD
85 requests.
86
87 -S Print response status chain. This shows redirect and authorization
88 requests that are handled by the library.
89
90 -e Print response headers. This option is always on for HEAD
91 requests.
92
93 -d Do not print the content of the response.
94
95 -o <format>
96 Process HTML content in various ways before printing it. If the
97 content type of the response is not HTML, then this option has no
98 effect. The legal format values are; text, ps, links, html and
99 dump.
100
101 If you specify the text format then the HTML will be formatted as
102 plain latin1 text. If you specify the ps format then it will be
103 formatted as Postscript.
104
105 The links format will output all links found in the HTML document.
106 Relative links will be expanded to absolute ones.
107
108 The html format will reformat the HTML code and the dump format
109 will just dump the HTML syntax tree.
110
111 Note that the "HTML-Tree" distribution needs to be installed for
112 this option to work. In addition the "HTML-Format" distribution
113 needs to be installed for -o text or -o ps to work.
114
115 -v Print the version number of the program and quit.
116
117 -h Print usage message and quit.
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
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
135 Gisle Aas <gisle@aas.no>
136
137
138
139perl v5.10.1 2017-03-22 GET(1)