3 hget, hpost, ok, urlencode \- retrieve, post to a web page corresponding to a url
62 retrieves the web page specified by the URL
64 and writes it, absent the
68 options, to standard output.
72 can be a relative path like
76 was specified with the
82 is of type HTTP and the
86 options are specified, then a HTTP POST is performed.
89 the data to be posted is provided by the
91 argument as a string or alternatively with
93 read from standard input.
101 to print the location URL from the transaction response
102 instead of retrieving the the body data. This is useful
103 for HTTP POST transactions that redirect to a URL containing
104 the posted data so we wont refetch the data we just uploaded
109 option is used to keep a local file in sync with a
110 web page. If the web page has been modified later than the
111 file, it is copied into the file. If the file is up to date
114 will fetch the missing bytes.
118 sends an arbitrary HTTP
123 overrides the HTTP method used for the request.
126 retrieves the web page specified by the URL
128 parses its HTML for form data, then prints
130 commands to submit the forms with default field
134 URL is provided with the
140 is invoked to execute the transaction submitting the form data.
146 flags set the form method to GET and POST, respectively. The
148 flag sets the form method to POST and its enctype to
149 .B multipart/form-data.
150 In all cases, the target relative form action URL is set to
155 flag sets the target URL to
159 parameter is always required, the
161 flag can be omitted when
163 follows directly after the last option if any.
165 The remaining arguments of the form
167 are interpreted as text form field names and values to be submitted. An
170 is interpreted as a file upload, with the information following the
172 symbol treated as the file name.
174 .B multipart/form-data
177 flag), the file has to be seekable as
179 is invoked to determine its mime type.
182 uploads the contents either of its standard input or
184 to the pastebin website
185 .B http://okturing.com
186 and then prints a URL where the contents may be retrieved.
189 is a helper program to URL encode and decode files. The
191 flag, instead of encode, decodes URL encoded file. If no
193 is given, standard input is read. The resulting data
194 is written to standard output.
196 Download a file from the web.
199 % hget http://9front.org/img/nix-on.jpg >/tmp/nix-on.jpg
202 Retrieve the commands needed to submit a form, which may then be
206 % hpost http://p.intma.in
207 /bin/hpost -u http://p.intma.in -p paste.cgi text:
210 Manually specify fields to be sent to a given
214 % hpost -u http://p.intma.in -p paste.cgi text:'test post'
217 Upload a file, print the resulting URL
220 % hpost -l http://i.intma.in file@/tmp/screen.png | rc
226 .B http://okturing.com
238 .B /sys/src/cmd/urlencode.c