3 hget, hpost, webpaste, urlencode \- retrieve, post to a web page corresponding to a url
66 retrieves the web page specified by the URL
68 and writes it, absent the
72 options, to standard output.
76 can be a relative path like
80 was specified with the
86 is of type HTTP and the
90 options are specified, then a HTTP POST is performed.
93 the data to be posted is provided by the
95 argument as a string or alternatively with
97 read from standard input.
105 to print the location URL from the transaction response
106 instead of retrieving the the body data. This is useful
107 for HTTP POST transactions that redirect to a URL containing
108 the posted data so we wont refetch the data we just uploaded
113 option is used to keep a local file in sync with a
114 web page. If the web page has been modified later than the
115 file, it is copied into the file. If the file is up to date
118 will fetch the missing bytes.
122 sends an arbitrary HTTP
127 overrides the HTTP method used for the request.
133 to emit download status on file descriptor 2,
134 suitable for use with
139 retrieves the web page specified by the URL
141 parses its HTML for form data, then prints
143 commands to submit the forms with default field
147 URL is provided with the
153 is invoked to execute the transaction submitting the form data.
159 flags set the form method to GET and POST, respectively. The
161 flag sets the form method to POST and its enctype to
162 .B multipart/form-data.
163 In all cases, the target relative form action URL is set to
168 flag sets the target URL to
172 parameter is always required, the
174 flag can be omitted when
176 follows directly after the last option if any.
178 The remaining arguments of the form
180 are interpreted as text form field names and values to be submitted. An
183 is interpreted as a file upload, with the information following the
185 symbol treated as the file name.
187 .B multipart/form-data
190 flag), the file has to be seekable as
192 is invoked to determine its mime type.
195 uploads the contents either of its standard input or
197 to the pastebin website
198 .B http://okturing.com
199 and then prints a URL where the contents may be retrieved.
202 is a helper program to URL encode and decode files. The
204 flag, instead of encode, decodes URL encoded file. If no
206 is given, standard input is read. The resulting data
207 is written to standard output.
209 Download a file from the web.
212 % hget http://9front.org/img/nix-on.jpg >/tmp/nix-on.jpg
222 hget -v -o 9front.iso.bz2 \\
223 http://www.r-36.net/9front/9front.iso.bz2 \\
224 |[2] aux/statusbar '9front.iso.bz2'
227 Retrieve the commands needed to submit a form, which may then be
231 % hpost http://p.intma.in
232 hpost -u http://p.intma.in -p paste.cgi text:
235 Manually specify fields to be sent to a given
239 % hpost -u http://p.intma.in -p paste.cgi text:'test post'
242 Upload a file, print the resulting URL
245 % hpost -l http://i.intma.in file@/tmp/screen.png | rc
251 .B http://okturing.com
263 .B /sys/src/cmd/urlencode.c
280 first appeared in Plan 9 from Bell Labs. It was
283 script for 9front (January, 2012).
287 first appeared in 9front (October, 2012).
289 first appeared in 9front (September, 2013).