|
你可以使用带 -c 参数的 HTTPie 继续下载。
# http --download --continue https://speed.hetzner.de/100MB.bin -o 100MB.binHTTP/1.1 206 Partial ContentConnection: keep-aliveContent-Length: 100442112Content-Range: bytes 4415488-104857599/104857600Content-Type: application/octet-streamDate: Tue, 09 Apr 2019 06:32:52 GMTETag: "5253f0fd-6400000"Last-Modified: Tue, 08 Oct 2013 11:48:13 GMTServer: nginxStrict-Transport-Security: max-age=15768000; includeSubDomains-
Downloading 100.00 MB to "100MB.bin" | 24.14 % 24.14 MB 1.12 MB/s 0:01:07 ETA^C
你根据下面的输出验证是否同一个文件:
[email protected]:/var/log# ls -lhtr 100MB.bin-rw-r--r-- 1 root root 25M Apr 9 01:33 100MB.bin
如何使用 HTTPie 上传文件?
你可以通过使用带有小于号 < 的 HTTPie 命令上传文件
$ http https://transfer.sh < Anbox-1.png
如何使用带有重定向符号 > 下载文件?
你可以使用带有重定向 > 符号的 HTTPie 命令下载文件。
# http https://www.2daygeek.com/wp-content/uploads/2019/03/How-To-Install-And-Enable-Flatpak-Support-On-Linux-1.png > Flatpak.png-
# ls -ltrh Flatpak.png-rw-r--r-- 1 root root 47K Apr 9 01:44 Flatpak.png
发送一个 HTTP GET 请求?
您可以在请求中发送 HTTP GET 方法。GET 方法会使用给定的 URI,从给定服务器检索信息。
# http GET httpie.orgHTTP/1.1 301 Moved PermanentlyCF-RAY: 4c4a83a3f90dcbe6-SINCache-Control: max-age=3600Connection: keep-aliveDate: Tue, 09 Apr 2019 06:44:44 GMTExpires: Tue, 09 Apr 2019 07:44:44 GMTLocation: https://httpie.org/Server: cloudflareTransfer-Encoding: chunkedVary: Accept-Encoding
提交表单?
使用以下格式提交表单。POST 请求用于向服务器发送数据,例如客户信息、文件上传等。要使用 HTML 表单。
# http -f POST Ubuntu18.2daygeek.com hello='World'HTTP/1.1 200 OKAccept-Ranges: bytesConnection: Keep-AliveContent-Encoding: gzipContent-Length: 3138Content-Type: text/htmlDate: Tue, 09 Apr 2019 06:48:12 GMTETag: "2aa6-5844bf1b047fc-gzip"Keep-Alive: timeout=5, max=100Last-Modified: Sun, 17 Mar 2019 15:29:55 GMTServer: Apache/2.4.29 (Ubuntu)Vary: Accept-Encoding
(编辑:应用网_阳江站长网)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|