nojima / httpie-go Goto Github PK
View Code? Open in Web Editor NEWhttpie-like HTTP client written in Go
License: MIT License
httpie-like HTTP client written in Go
License: MIT License
From https://httpie.org/doc:
JSON data is indented, sorted by keys, and unicode escapes are converted to the characters they represent.
The original Python implementation of httpie supports reading from ~/.netrc
by default. curl
supports ~/.netrc
with the -n
flag. It'd be great if httpie-go
could also support ~/.netrc
Positional な引数がひとつの場合:
第一引数を URL として解釈する。
Positional な引数がふたつ以上ある場合:
第一引数が ^[a-zA-Z]+$
にマッチするならば METHOD として解釈し、そうでなければ URL として解釈する。
The prebuilt binaries provided on release page only support amd64 architecture, how about building this tool for arm64 platforms as well on Linux and MacOS? Is it possible with CircleCI?
From man of httpie:
--form, -f
Data items from the command line are serialized as form fields.
The Content-Type is set to application/x-www-form-urlencoded (if not specified). The presence of any file fields results in a multipart/form-data request.
In httppie version 0.9.8 the output option works like so:
--output FILE, -o FILE
Save output to FILE instead of stdout. If --download is also set, then only
the response body is saved to FILE. Other parts of the HTTP exchange are
printed to stderr.
But in httpie-go 0.7.0 it works like so:
-o, --output=value output file
Therefore in httppie you would use:
http https://httpbin.org/get -o test.txt
but in http-go
http-go https://httpbin.org/get -o="test.txt"
I don't know if it is intended or not but it breaks compatibility
It appears that the current released version of httpie-go (0.7.0) lacks digest and bearer authentication support. My question is should these methods be supported as well?
httpie-go skips everything in the middle and shows the final result. HTTPie shows all the redirects and their related headers or bodies (respective of params).
➜ auth git:(gds) ht -Fvh https://google.com
HTTP/2.0 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Date: Mon, 26 Jul 2021 21:45:40 GMT
Expires: -1
P3p: CP="This is not a P3P policy! See g.co/p3phelp for more info."
Server: gws
Set-Cookie: 1P_JAR=2021-07-26-21; expires=Wed, 25-Aug-2021 21:45:40 GMT; path=/; domain=.google.com; Secure
Set-Cookie: NID=220=PbsBwy_-qlQkTuwp-JCnTZDn1L1ejUzmdU6ntxNfPikOOSY01__hvR1WPG7wTpSCMG55jkcj1ScIz_6cNG7flk3Avfb6KKb2BH9Nv5f-vXanfdB23NdLn6LUcZPUkNrTh26S3L7sYSpb6OUMpDeYruSUM_GwVUDFbB-TrLir3JM; expires=Tue, 25-Jan-2022 21:45:40 GMT; path=/; domain=.google.com; HttpOnly
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0
➜ auth git:(gds) http -Fvh https://google.com
HTTP/1.1 301 Moved Permanently
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: public, max-age=2592000
Content-Length: 220
Content-Type: text/html; charset=UTF-8
Date: Mon, 26 Jul 2021 21:45:52 GMT
Expires: Wed, 25 Aug 2021 21:45:52 GMT
Location: https://www.google.com/
Server: gws
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
HTTP/1.1 200 OK
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0
Content-Encoding: gzip
Content-Type: text/html; charset=ISO-8859-1
Date: Mon, 26 Jul 2021 21:45:53 GMT
Expires: -1
P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
Server: gws
Set-Cookie: 1P_JAR=2021-07-26-21; expires=Wed, 25-Aug-2021 21:45:53 GMT; path=/; domain=.google.com; Secure
Set-Cookie: NID=220=ATD0Gaaal5313XDyFgcFsa8ENCW3IVbeN3oaO-SHsLvq5LZMZrmhgxtEkIu08j7ou_kt8HzxThBUA28uPJrAmopGHIIzqsAqgIE0oTHj1r4Wb0sGjqTDDBCf3-riucl0uCMC8LWgZkbPPP1P6apTqj374EFfJCkj1jlBbjVyuvE; expires=Tue, 25-Jan-2022 21:45:53 GMT; path=/; domain=.google.com; HttpOnly
Transfer-Encoding: chunked
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 0
When I httpie-go -v https://keelii.com/ I get an error!
was using the python httpie
for debugging, but its shortcoming was HTTP1 only, tried to install some httpie-http2
plugin solution, but none of those works:
For uninstallations, please use either "httpie plugins uninstall httpie-http2" or "pip uninstall httpie-http2" (depending on how you installed it in the first place).
heard Golang library handles HTTP/2 binary protocols better, not sure can this have a feature to use http2 above only scenario ?
--http1 force HTTP/1.1 protocol
--http2 force HTTP/2 protocol ?? and
--http2+ force HTTP/2 protocol above?
--http3 force HTTP/3 protocol ?? and
Having a nice clean executable instead of a bunch of python setup is wonderful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.