3 hget, hpost, urlencode \- retrieve, post to a web page corresponding to a url
59 retrieves the web page specified by the URL
61 and writes it, absent the
65 options, to standard output.
69 can be a relative path like
73 was specified with the
79 is of type HTTP and the
83 options are specified, then a HTTP POST is performed.
86 the data to be posted is provided by the
88 argument as a string or alternatively with
90 read from standard input.
98 to print the location URL from the transactoin response
99 instead of retriving the the body data. This is usefull
100 for HTTP POST transactions that redirect to a URL containing
101 the prosted data so we wont refetch the data we just uploaded
106 option is used to keep a local file in sync with a
107 web page. If the web page has been modified later than the
108 file, it is copied into the file. If the file is up to date
111 will fetch the missing bytes.
115 sends an arbitrary HTTP
120 overrides the HTTP method used for the request.
123 retrieves the web page specified by the URL
125 parses its HTML for form data, then prints
127 commands to submit the forms with default field
131 URL is provided with the
137 is invoked to execute the transaction submitting the form data.
143 flags set the form method to GET and POST, respectively. The
145 flag sets the form method to POST and its enctype to
146 .B multipart/form-data.
147 In all cases, the target relative form action URL is set to
152 flag sets the target URL to
156 parameter is always required, the
158 flag can be omited when
160 follows directly after the last option if any.
162 The remaining arguments of the form
164 are interpreted as text form field names and values to be submitted. An
167 is interpreted as a file upload, with the information following the
169 symbol treated as the file name.
171 .B multipart/form-data
174 flag), the file has to be seekable as
176 is invoked to determine its mime type.
179 is a helper program to URL encode and decode files. The
181 flag, instead of encode, decodes URL encoded file. If no
183 is given, standard input is read. The resulting data
184 is written to standard output.
186 Download a file from the web.
189 % hget http://9front.org/img/nix-on.jpg >/tmp/nix-on.jpg
192 Retrieve the commands needed to submit a form, which may then be
196 % hpost http://p.intma.in
197 /bin/hpost -u http://p.intma.in -p paste.cgi text:
200 Manually specify fields to be sent to a given
204 % hpost -u http://p.intma.in -p paste.cgi text:'test post'
207 Upload a file, print the resulting URL
210 % hpost -l http://i.intma.in file@/tmp/screen.png | rc
217 .B /sys/src/cmd/urlencode.c