246 lines
7.2 KiB
HTML
246 lines
7.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of LWP-REQUEST</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>LWP-REQUEST</H1>
|
|
Section: User Contributed Perl Documentation (1p)<BR>Updated: 2019-11-29<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
lwp-request - Simple command line user agent
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
<B>lwp-request</B> [<B>-afPuUsSedvhx</B>] [<B>-m</B> <I>method</I>] [<B>-b</B> <I>base </I><FONT SIZE="-1"><I>URL</I></FONT><I></I>] [<B>-t</B> <I>timeout</I>]
|
|
<BR> [<B>-i</B> <I>if-modified-since</I>] [<B>-c</B> <I>content-type</I>]
|
|
<BR> [<B>-C</B> <I>credentials</I>] [<B>-p</B> <I>proxy-url</I>] [<B>-o</B> <I>format</I>] <I>url</I>...
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
This program can be used to send requests to <FONT SIZE="-1">WWW</FONT> servers and your
|
|
local file system. The request content for <FONT SIZE="-1">POST</FONT> and <FONT SIZE="-1">PUT</FONT>
|
|
methods is read from stdin. The content of the response is printed on
|
|
stdout. Error messages are printed on stderr. The program returns a
|
|
status value indicating the number of URLs that failed.
|
|
<P>
|
|
|
|
The options are:
|
|
<DL COMPACT>
|
|
<DT id="1">-m <method><DD>
|
|
|
|
|
|
Set which method to use for the request. If this option is not used,
|
|
then the method is derived from the name of the program.
|
|
<DT id="2">-f<DD>
|
|
|
|
|
|
Force request through, even if the program believes that the method is
|
|
illegal. The server might reject the request eventually.
|
|
<DT id="3">-b <uri><DD>
|
|
|
|
|
|
This <FONT SIZE="-1">URI</FONT> will be used as the base <FONT SIZE="-1">URI</FONT> for resolving all relative URIs
|
|
given as argument.
|
|
<DT id="4">-t <timeout><DD>
|
|
|
|
|
|
Set the timeout value for the requests. The timeout is the amount of
|
|
time that the program will wait for a response from the remote server
|
|
before it fails. The default unit for the timeout value is seconds.
|
|
You might append ``m'' or ``h'' to the timeout value to make it minutes or
|
|
hours, respectively. The default timeout is '3m', i.e. 3 minutes.
|
|
<DT id="5">-i <time><DD>
|
|
|
|
|
|
Set the If-Modified-Since header in the request. If <I>time</I> is the
|
|
name of a file, use the modification timestamp for this file. If
|
|
<I>time</I> is not a file, it is parsed as a literal date. Take a look at
|
|
HTTP::Date for recognized formats.
|
|
<DT id="6">-c <content-type><DD>
|
|
|
|
|
|
Set the Content-Type for the request. This option is only allowed for
|
|
requests that take a content, i.e. <FONT SIZE="-1">POST</FONT> and <FONT SIZE="-1">PUT.</FONT> You can
|
|
force methods to take content by using the <TT>"-f"</TT> option together with
|
|
<TT>"-c"</TT>. The default Content-Type for <FONT SIZE="-1">POST</FONT> is
|
|
<TT>"application/x-www-form-urlencoded"</TT>. The default Content-type for
|
|
the others is <TT>"text/plain"</TT>.
|
|
<DT id="7">-p <proxy-url><DD>
|
|
|
|
|
|
Set the proxy to be used for the requests. The program also loads
|
|
proxy settings from the environment. You can disable this with the
|
|
<TT>"-P"</TT> option.
|
|
<DT id="8">-P<DD>
|
|
|
|
|
|
Don't load proxy settings from environment.
|
|
<DT id="9">-H <header><DD>
|
|
|
|
|
|
Send this <FONT SIZE="-1">HTTP</FONT> header with each request. You can specify several, e.g.:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
lwp-request \
|
|
-H 'Referer: <A HREF="http://other.url/'">http://other.url/'</A> \
|
|
-H 'Host: somehost' \
|
|
<A HREF="http://this.url/">http://this.url/</A>
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="10">-C <username>:<password><DD>
|
|
|
|
|
|
Provide credentials for documents that are protected by Basic
|
|
Authentication. If the document is protected and you did not specify
|
|
the username and password with this option, then you will be prompted
|
|
to provide these values.
|
|
</DL>
|
|
<P>
|
|
|
|
The following options controls what is displayed by the program:
|
|
<DL COMPACT>
|
|
<DT id="11">-u<DD>
|
|
|
|
|
|
Print request method and absolute <FONT SIZE="-1">URL</FONT> as requests are made.
|
|
<DT id="12">-U<DD>
|
|
|
|
|
|
Print request headers in addition to request method and absolute <FONT SIZE="-1">URL.</FONT>
|
|
<DT id="13">-s<DD>
|
|
|
|
|
|
Print response status code. This option is always on for <FONT SIZE="-1">HEAD</FONT> requests.
|
|
<DT id="14">-S<DD>
|
|
|
|
|
|
Print response status chain. This shows redirect and authorization
|
|
requests that are handled by the library.
|
|
<DT id="15">-e<DD>
|
|
|
|
|
|
Print response headers. This option is always on for <FONT SIZE="-1">HEAD</FONT> requests.
|
|
<DT id="16">-E<DD>
|
|
|
|
|
|
Print response status chain with full response headers.
|
|
<DT id="17">-d<DD>
|
|
|
|
|
|
Do <B>not</B> print the content of the response.
|
|
<DT id="18">-o <format><DD>
|
|
|
|
|
|
Process <FONT SIZE="-1">HTML</FONT> content in various ways before printing it. If the
|
|
content type of the response is not <FONT SIZE="-1">HTML,</FONT> then this option has no
|
|
effect. The legal format values are; <TT>"text"</TT>, <TT>"ps"</TT>, <TT>"links"</TT>,
|
|
<TT>"html"</TT> and <TT>"dump"</TT>.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If you specify the <TT>"text"</TT> format then the <FONT SIZE="-1">HTML</FONT> will be formatted as
|
|
plain <TT>"latin1"</TT> text. If you specify the <TT>"ps"</TT> format then it will be
|
|
formatted as Postscript.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <TT>"links"</TT> format will output all links found in the <FONT SIZE="-1">HTML</FONT> document.
|
|
Relative links will be expanded to absolute ones.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <TT>"html"</TT> format will reformat the <FONT SIZE="-1">HTML</FONT> code and the <TT>"dump"</TT> format
|
|
will just dump the <FONT SIZE="-1">HTML</FONT> syntax tree.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Note that the <TT>"HTML-Tree"</TT> distribution needs to be installed for this
|
|
option to work. In addition the <TT>"HTML-Format"</TT> distribution needs to
|
|
be installed for <TT>"-o text"</TT> or <TT>"-o ps"</TT> to work.
|
|
<DT id="19">-v<DD>
|
|
|
|
|
|
Print the version number of the program and quit.
|
|
<DT id="20">-h<DD>
|
|
|
|
|
|
Print usage message and quit.
|
|
<DT id="21">-a<DD>
|
|
|
|
|
|
Set text(ascii) mode for content input and output. If this option is not
|
|
used, content input and output is done in binary mode.
|
|
</DL>
|
|
<P>
|
|
|
|
Because this program is implemented using the <FONT SIZE="-1">LWP</FONT> library, it will
|
|
only support the protocols that <FONT SIZE="-1">LWP</FONT> supports.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
lwp-mirror, <FONT SIZE="-1">LWP</FONT>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 1995-1999 Gisle Aas.
|
|
<P>
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the same terms as Perl itself.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
Gisle Aas <<A HREF="mailto:gisle@aas.no">gisle@aas.no</A>>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="22"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="23"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="24"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="25"><A HREF="#lbAE">SEE ALSO</A><DD>
|
|
<DT id="26"><A HREF="#lbAF">COPYRIGHT</A><DD>
|
|
<DT id="27"><A HREF="#lbAG">AUTHOR</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:18 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|