The Wayback Machine - https://web.archive.org/web/20230307083330/https://github.com/WeihanLi/dotnet-httpie
Skip to content

WeihanLi/dotnet-httpie

dev
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

dotnet-HTTPie

dotnet-HTTPie

dotnet-HTTPie Latest

Github Actions Build Status

Docker Pulls

Intro

dotnet tool version of httpie, Modern, user-friendly command-line HTTP client for the API era.

httpie

HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs & HTTP servers.

Install

Install .NET SDK before you get started with this tool, when you had .NET SDK installed, run the command below to install the latest stable version tool

dotnet tool update --global dotnet-httpie

For latest preview version, run the following command instead:

dotnet tool update --global dotnet-httpie --prerelease

GetStarted

Now you can use the tool to call your API you want

Usages:

dotnet-http [flags] [METHOD] URL [ITEM [ITEM]]

There're three types of item

Type Grammar
Query name==test
Header X-Api-Key:test
Request-Data name=test, raw data field example(Only effective for JSON): age:=10, job:='{"Id":1,"Name":"test"}'(Escape needed for Windows)

Here's a sample: sample

More examples you may wanna have a look

dotnet-http :5000/api/values
dotnet-http localhost:5000/api/values
dotnet-http get https://reservation.weihanli.xyz/api/notice --body
dotnet-http /api/notice title=test body=test-body
dotnet-http post http://localhost/api/notice title=test body=test-body

Docker

There's a docker image(weihanli/dotnet-httpie) that you could use directly without installing the tool, use sample:

docker run --rm --pull=always weihanli/dotnet-httpie:latest http -v github.com

docker run --rm --pull=always weihanli/dotnet-httpie:latest http reservation.weihanli.xyz/health job:='{"id":1,"name":"tester"}' --offline

docker run --rm --pull=always weihanli/dotnet-httpie:latest http PUT httpbin.org hello=world

docker run --rm --pull=always weihanli/dotnet-httpie:latest http get httpbin.org/status/400

More

For detailed document: have a look at HTTPie documents https://httpie.io/docs#examples

References

About

Amazing HTTP command-line tool powered by .NET, inspired by httpie

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages