Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joncloud/https

Simple CLI for sending HTTP requests
https://github.com/joncloud/https

cli http http-client https request simple

Last synced: about 1 month ago
JSON representation

Simple CLI for sending HTTP requests

Awesome Lists containing this project

README

        

# https
[![NuGet](https://img.shields.io/nuget/v/https.svg)](https://www.nuget.org/packages/https/)
[![Build Status](https://dev.azure.com/joncloud/joncloud-github/_apis/build/status/joncloud.https?branchName=publish)](https://dev.azure.com/joncloud/joncloud-github/_build/latest?definitionId=13&branchName=publish)

## Description
`https` is a simple CLI for sending HTTP requests.

## Licensing
Released under the MIT License. See the [LICENSE][] File for further details.

[license]: LICENSE.md

## Installation
Install `https` as a global .NET tool using
```bash
dotnet tool install --global https --version 0.3.0-*
```

## Usage
Urls without a protocol, i.e., `http://` or `https://`, by default will be assigns the `https://` protocol.

```bash
Usage: https [options] [content]

Submits HTTP requests. For example https put httpbin.org/put hello=world

Arguments:
HTTP method, i.e., get, head, post
URI to send the request to. Leaving the protocol off the URI defaults to https://

Options:
--form Renders the content arguments as application/x-www-form-urlencoded
--help Show command line help.
--ignore-certificate Prevents server certificate validation.
--json Renders the content arguments as application/json.
--timeout= Sets the timeout of the request using System.TimeSpan.TryParse (https://docs.microsoft.com/en-us/dotnet/api/system.timespan.parse)
--version Displays the application verison.
--xml= Renders the content arguments as application/xml using the optional xml root name.
--stop-auto-redirects Prevents redirects from automatically being processed.

Content:
Repeat as many content arguments to create content sent with the HTTP request. Alternatively pipe raw content send as the HTTP request content.
=

Headers:
Repeat as many header arguments to assign headers for the HTTP request.
:
```

For example `https put httpbin.org/put hello=world` will output:
```
HTTP/1.1 200 OK
Connection: keep-alive
Server: gunicorn/19.9.0
Date: Sat, 13 Oct 2018 03:09:13 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Via: 1.1 vegur
Content-Type: application/json
Content-Length: 423
{
"args": {},
"data": "{\"hello\":\"world\"}",
"files": {},
"form": {},
"headers": {
"Connection": "close",
"Content-Length": "17",
"Content-Type": "application/json; charset=utf-8",
"Host": "httpbin.org",
"User-Agent": "dotnet-https/0.1.1.0",
"X-Content": "content-x"
},
"json": {
"hello": "world"
},
"origin": "50.53.112.92",
"url": "https://httpbin.org/put"
}
```