3 hget, hpost, webpaste, urlencode \- retrieve, post to a web page corresponding to a url
64 retrieves the web page specified by the URL
66 and writes it, absent the
70 options, to standard output.
74 can be a relative path like
78 was specified with the
84 is of type HTTP and the
88 options are specified, then a HTTP POST is performed.
91 the data to be posted is provided by the
93 argument as a string or alternatively with
95 read from standard input.
103 to print the location URL from the transaction response
104 instead of retrieving the the body data. This is useful
105 for HTTP POST transactions that redirect to a URL containing
106 the posted data so we wont refetch the data we just uploaded
111 option is used to keep a local file in sync with a
112 web page. If the web page has been modified later than the
113 file, it is copied into the file. If the file is up to date
116 will fetch the missing bytes.
120 sends an arbitrary HTTP
125 overrides the HTTP method used for the request.
128 retrieves the web page specified by the URL
130 parses its HTML for form data, then prints
132 commands to submit the forms with default field
136 URL is provided with the
142 is invoked to execute the transaction submitting the form data.
148 flags set the form method to GET and POST, respectively. The
150 flag sets the form method to POST and its enctype to
151 .B multipart/form-data.
152 In all cases, the target relative form action URL is set to
157 flag sets the target URL to
161 parameter is always required, the
163 flag can be omitted when
165 follows directly after the last option if any.
167 The remaining arguments of the form
169 are interpreted as text form field names and values to be submitted. An
172 is interpreted as a file upload, with the information following the
174 symbol treated as the file name.
176 .B multipart/form-data
179 flag), the file has to be seekable as
181 is invoked to determine its mime type.
184 uploads the contents either of its standard input or
186 to the pastebin website
187 .B http://okturing.com
188 and then prints a URL where the contents may be retrieved.
191 is a helper program to URL encode and decode files. The
193 flag, instead of encode, decodes URL encoded file. If no
195 is given, standard input is read. The resulting data
196 is written to standard output.
198 Download a file from the web.
201 % hget http://9front.org/img/nix-on.jpg >/tmp/nix-on.jpg
204 Retrieve the commands needed to submit a form, which may then be
208 % hpost http://p.intma.in
209 hpost -u http://p.intma.in -p paste.cgi text:
212 Manually specify fields to be sent to a given
216 % hpost -u http://p.intma.in -p paste.cgi text:'test post'
219 Upload a file, print the resulting URL
222 % hpost -l http://i.intma.in file@/tmp/screen.png | rc
228 .B http://okturing.com
240 .B /sys/src/cmd/urlencode.c
257 first appeared in Plan 9 from Bell Labs. It was
260 script for 9front (January, 2012).
264 first appeared in 9front (October, 2012).
266 first appeared in 9front (September, 2013).