hget(1): fix man page errors, add another example

This commit is contained in:
stanley lieber 2012-10-11 22:06:11 -05:00
parent fe13029eb4
commit 2f83fa7f74

View file

@ -135,7 +135,7 @@ The
.B -g .B -g
and and
.B -p .B -p
flags set the the form method to GET and POST, respectively. The flags set the form method to GET and POST, respectively. The
.B -m .B -m
flag sets the form method to POST and its enctype to multipart/form-data. flag sets the form method to POST and its enctype to multipart/form-data.
In all cases, the form action is set to In all cases, the form action is set to
@ -143,8 +143,8 @@ In all cases, the form action is set to
.PP .PP
The remaining arguments of the form The remaining arguments of the form
.B name:value .B name:value
are interpreted as form field names and values to be submitted along are interpreted as form field names and values to be submitted. An
with the form. An argument of the form argument of the form
.B name:@value .B name:@value
is interpreted as a file upload, with the information following the is interpreted as a file upload, with the information following the
.B @ .B @
@ -162,12 +162,20 @@ hget -p 'text=' http://p.intma.in/paste.cgi
.PP .PP
Manually specify options to be sent to a given Manually specify options to be sent to a given
.I url. .I url.
Note: The target HTML is not fetched and interpreted.
.IP .IP
.EX .EX
% formpost -u http://p.intma.in -p paste.cgi 'text:test post' % formpost -u http://p.intma.in -p paste.cgi 'text:test post'
hget -p 'text=test+post' http://p.intma.in/paste.cgi hget -p 'text=test+post' http://p.intma.in/paste.cgi
.EE .EE
.PP
Upload a file.
.IP
.EX
% formpost -M file:@/tmp/screen.png | \\
hget -P \\
-r 'Content-Type: multipart/form-data, boundary=HJBOUNDARY' \\
http://i.intma.in/up.cgi
.EE
.SH SOURCE .SH SOURCE
.B /rc/bin/hget .B /rc/bin/hget
.br .br