Telepítés a Miniconda révén (Linux, macOS, Windows):
conda config --add channels conda-forge
conda install httpie
http
http --version
http --help
man http
Dokumentáció: https://httpie.io/docs/cli
Webhely: https://ip-api.com/
http http://ip-api.com/json
http http://ip-api.com/json -v
http http://ip-api.com/json --download
http http://ip-api.com/json -d
http http://ip-api.com/json --print Hh
http ip-api.com/json
Webhely: http://www.w3.org/
http http://w3.org
http http://w3.org --follow -d -o w3.html -v
http http://w3.org -F -d -o w3.html -v
URL rövidítő szolgáltatás: https://is.gd/
http https://is.gd/create.php?format=simple\&url=https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP -d -o shorturl.txt
cat shorturl.txt
cat shorturl.txt | xargs http --print=h HEAD | grep -i ^Location
Webhely: http://www.gnu.org/
http http://www.gnu.org/ Accept-Language:de -p Hh
http http://www.gnu.org/ Accept-Language:de -p Hh -d -o gnu.de.html
http http://www.gnu.org/ Accept-Language:fr -p Hh -d -o gnu.fr.html
Webhely: https://www.youtube.com/
http https://www.youtube.com/ "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1"
Lásd: https://www.whatismybrowser.com/guides/the-latest-user-agent/
Lásd: https://www.dbpedia.org/
http https://dbpedia.org/resource/Grumpy_Cat -v
http https://dbpedia.org/resource/Grumpy_Cat Accept:text/html -d -o Grumpy_Cat.html -v
http https://dbpedia.org/resource/Grumpy_Cat Accept:application/json -v
http https://dbpedia.org/resource/Grumpy_Cat Accept:application/json -d -v
Lásd: https://download.bbbike.org/osm/bbbike/Budapest/
Szakítsuk meg az átvitelt a CTRL + C megnyomásával:
http https://download.bbbike.org/osm/bbbike/Budapest/Budapest.osm.gz -d
Az átvitel folytatása:
http https://download.bbbike.org/osm/bbbike/Budapest/Budapest.osm.gz -d -c -o Budapest.osm.gz
Lásd: https://www.gnu.org/licenses/gpl-3.0.txt
Az első 100 bájt:
http https://www.gnu.org/licenses/gpl-3.0.txt Range:bytes=0-99 -d -v
Az utolsó 100 bájt:
http https://www.gnu.org/licenses/gpl-3.0.txt Accept-Encoding: Range:bytes=-100 -d -v
Az első és utolsó 100 bájt:
http https://www.gnu.org/licenses/gpl-3.0.txt Accept-Encoding: Range:bytes=0-99,-100 -v
Webhely: https://httpbin.org/
A rendelkezésre álló lehetőségek:
-
GET metódus:
http http://httpbin.org/get string==bazinga number==42 -v http http://httpbin.org/get "string==Hello, World!" number==42 -v
-
POST metódus az
application/x-www-form-urlencoded
média típussal:http --form http://httpbin.org/post string=bazinga number=42 -v
-
POST metódus a
multipart/form-data
média típussal:http --multipart http://httpbin.org/post string=bazinga number=42 -v
Webhely: https://blackwells.co.uk/
http https://blackwells.co.uk/bookshop/search?keyword=sherlock+holmes\&pubDateFrom=2022\&pubDateTo=2023 -d -o search.html -v
http https://blackwells.co.uk/bookshop/search keyword==sherlock+holmes pubDateFrom==2022 pubDateTo==2023 -d -o search.html -v
Webhely: https://www.base64encode.org/
http -f POST https://www.base64encode.org/ input="Hello, world!" charset=UTF-8 separator=lf -d -o output.html -v
Webhely: https://validator.nu/
http https://validator.nu/ doc==https://www.w3.org/ -d -o output.html -v
Lásd: https://validator.nu/#file
http https://www.w3.org/ -d -o index.html
http -f POST https://validator.nu/ [email protected] -d -o output.html -v
Lásd: https://wttr.in/, https://github.com/chubin/wttr.in
http http://wttr.in
http http://wttr.in/:help
http http://wttr.in/London
http http://wttr.in/New+York
http http://wttr.in/~Tower+Bridge
http http://wttr.in/~Mount+Everest
http http://wttr.in/ Accept-Language:en
http http://wttr.in/ Accept-Language:de
http http://wttr.in?lang=hu
http http://wttr.in?lang=en
http http://wttr.in?lang=de
http http://hu.wttr.in
http http://de.wttr.in
http http://wttr.in/?format=1
http http://wttr.in/?format=2
http http://wttr.in/?format=3
http http://wttr.in/?format=4
http http://wttr.in/?format=j1
http http://wttr.in/Budapest?format=v2
http http://v2.wttr.in/Budapest
http http://wttr.in/Moon
Lásd: https://validator.nu/ https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params
http https://validator.nu/ doc==https://whatwg.org/ out==json -v
http https://validator.nu/ doc==https://whatwg.org/ out==xml -v
http https://validator.nu/ doc==https://www.w3.org/ out==xml -v
http https://validator.nu/ doc==https://www.w3.org/ out==xml level==error -v
http https://whatwg.org/ -d -o whatwg.html
http POST https://validator.nu/?out=xml @whatwg.html "Content-type:text/html;charset=utf-8" -v
Lásd: https://temp.sh/
echo "Hello, World!" > hello.txt
http --multipart https://temp.sh/upload [email protected] -v
Lásd: https://httpie.io/docs/cli/sessions
rm -f youtube.json
http --session=./youtube.json https://www.youtube.com/ -d -v
less youtube.json
http --session=./youtube.json https://www.youtube.com/watch?v=pTBjHjRhx_Y -d -v
Webhely: Rebrickable API
Swagger UI az API-hoz: https://rebrickable.com/api/v3/swagger/
Az API használatához API kulcs szükséges, mely itt generálható (bejelentkezés szükséges).
http https://rebrickable.com/api/v3/lego/sets/60386-1/ "Authorization: key <your-api-key>" -v
http https://rebrickable.com/api/v3/lego/sets/60386-1/minifigs/ "Authorization: key <your-api-key>" -v
http https://rebrickable.com/api/v3/lego/sets/60386-1/parts/ "Authorization: key <your-api-key>" -v
http https://api.github.com/user -v
http https://api.github.com/user -v -a <username>
Lásd:
- https://docs.github.com/en/rest
- https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
Lásd: http://httpbin.org/#/Anything, https://httpie.io/docs/cli/json
http http://httpbin.org/anything name="Tim Berners-Lee" [email protected] url=https://www.w3.org/People/Berners-Lee/ -v
http http://httpbin.org/anything title="The Big Bang Theory" year:=2007 seasons:=12 ended:=true genres:='["comedy", "romance"]' -v
http http://httpbin.org/anything title="The Big Bang Theory" year:=2007 seasons:=12 ended:=true genres[]=comedy genres[]=romance -v
http http://httpbin.org/anything title="The Big Bang Theory" year:=2007 seasons:=12 ended:=true genres[1]=romance genres[0]=comedy -v
http http://httpbin.org/anything title="The Big Bang Theory" year:=2007 cast:='{"Leonard Hofstadter": "Johnny Galecki", "Sheldon Cooper": "Jim Parsons", "Penny": "Kaley Cuoco", "Howard Wolowitz": "Simon Helberg", "Raj Koothrappali": "Kunal Nayyar", "Bernadette Rostenkowski": "Melissa Rauch", "Amy Farrah Fowler": "Mayim Bialik"}' -v
http http://httpbin.org/anything title="The Big Bang Theory" year:=2007 cast["Leonard Hofstadter"]="Johnny Galecki" cast["Sheldon Cooper"]="Jim Parsons" cast[Penny]="Kaley Cuoco" cast["Howard Wolowitz"]="Simon Helberg" cast["Raj Koothrappali"]="Kunal Nayyar" cast["Bernadette Rostenkowski"]="Melissa Rauch" cast["Amy Farrah Fowler"]="Mayim Bialik" -v