forked from extern/httpie-cli
Compare commits
22 Commits
3.2.0
...
fix-initia
Author | SHA1 | Date | |
---|---|---|---|
9d2e2afede | |||
418b12bbd6 | |||
ecff53f2d5 | |||
41da87f7c8 | |||
4f172a61b4 | |||
542a2d35de | |||
d9e1dc08c9 | |||
3b734fb0bc | |||
8abe47969e | |||
8173cb0337 | |||
7fd34fc8ce | |||
80ae644464 | |||
69fe5dbfd1 | |||
f09e7564e7 | |||
dc5274e491 | |||
ad2b86ccf4 | |||
11b2af0f59 | |||
b54239b525 | |||
b0b0f3dc53 | |||
9f7612cdeb | |||
5e76ebc5e1 | |||
343a521673 |
17
.github/workflows/release-choco.yml
vendored
17
.github/workflows/release-choco.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
name: Release the Chocolatey
|
name: Release the Chocolatey
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
env:
|
env:
|
||||||
package-dir: ./httpie/docs/packaging/windows-chocolatey
|
package-dir: docs\packaging\windows-chocolatey
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -30,9 +30,21 @@ jobs:
|
|||||||
run: choco info httpie -s .
|
run: choco info httpie -s .
|
||||||
working-directory: ${{ env.package-dir }}
|
working-directory: ${{ env.package-dir }}
|
||||||
|
|
||||||
- name: Check the Installation
|
- name: Local installation
|
||||||
run: |
|
run: |
|
||||||
choco install httpie -y -dv -s "'.;https://community.chocolatey.org/api/v2/'"
|
choco install httpie -y -dv -s "'.;https://community.chocolatey.org/api/v2/'"
|
||||||
|
working-directory: ${{ env.package-dir }}
|
||||||
|
|
||||||
|
- name: Test the locally installed binaries
|
||||||
|
run: |
|
||||||
|
# Source: https://stackoverflow.com/a/46760714/15330941
|
||||||
|
|
||||||
|
# Make `refreshenv` available right away, by defining the $env:ChocolateyInstall
|
||||||
|
# variable and importing the Chocolatey profile module.
|
||||||
|
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
|
||||||
|
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
|
||||||
|
refreshenv
|
||||||
|
|
||||||
http --version
|
http --version
|
||||||
https --version
|
https --version
|
||||||
httpie --version
|
httpie --version
|
||||||
@ -46,3 +58,4 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
choco apikey --key $CHOCO_API_KEY --source https://push.chocolatey.org/
|
choco apikey --key $CHOCO_API_KEY --source https://push.chocolatey.org/
|
||||||
choco push httpie*.nupkg --source https://push.chocolatey.org/
|
choco push httpie*.nupkg --source https://push.chocolatey.org/
|
||||||
|
working-directory: ${{ env.package-dir }}
|
||||||
|
21
.github/workflows/release-linux-standalone.yml
vendored
21
.github/workflows/release-linux-standalone.yml
vendored
@ -7,6 +7,9 @@ on:
|
|||||||
description: "The branch, tag or SHA to release from"
|
description: "The branch, tag or SHA to release from"
|
||||||
required: true
|
required: true
|
||||||
default: "master"
|
default: "master"
|
||||||
|
tag_name:
|
||||||
|
description: "Which release to upload the artifacts to (e.g., 3.0)"
|
||||||
|
required: true
|
||||||
|
|
||||||
release:
|
release:
|
||||||
types: [released, prereleased]
|
types: [released, prereleased]
|
||||||
@ -45,24 +48,30 @@ jobs:
|
|||||||
name: httpie.rpm
|
name: httpie.rpm
|
||||||
path: extras/packaging/linux/artifacts/dist/*.rpm
|
path: extras/packaging/linux/artifacts/dist/*.rpm
|
||||||
|
|
||||||
|
- name: Determine the release upload upload_url
|
||||||
|
id: release_id
|
||||||
|
run: |
|
||||||
|
pip install httpie
|
||||||
|
export API_URL="api.github.com/repos/httpie/httpie/releases/tags/${{ github.event.inputs.tag_name }}"
|
||||||
|
export UPLOAD_URL=`https --ignore-stdin GET $API_URL | jq -r ".upload_url"`
|
||||||
|
echo "::set-output name=UPLOAD_URL::$UPLOAD_URL"
|
||||||
|
|
||||||
- name: Publish Debian Package
|
- name: Publish Debian Package
|
||||||
if: github.event_name == 'release'
|
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
upload_url: ${{ steps.release_id.outputs.UPLOAD_URL }}
|
||||||
asset_path: extras/packaging/linux/artifacts/dist/httpie-${{ github.event.release.tag_name }}.deb
|
asset_path: extras/packaging/linux/artifacts/dist/httpie_${{ github.event.inputs.tag_name }}_amd64.deb
|
||||||
asset_name: httpie-${{ github.event.release.tag_name }}.deb
|
asset_name: httpie-${{ github.event.inputs.tag_name }}.deb
|
||||||
asset_content_type: binary/octet-stream
|
asset_content_type: binary/octet-stream
|
||||||
|
|
||||||
- name: Publish Single Executable
|
- name: Publish Single Executable
|
||||||
if: github.event_name == 'release'
|
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
upload_url: ${{ steps.release_id.outputs.UPLOAD_URL }}
|
||||||
asset_path: extras/packaging/linux/artifacts/dist/http
|
asset_path: extras/packaging/linux/artifacts/dist/http
|
||||||
asset_name: http
|
asset_name: http
|
||||||
asset_content_type: binary/octet-stream
|
asset_content_type: binary/octet-stream
|
||||||
|
2
.github/workflows/release-pypi.yml
vendored
2
.github/workflows/release-pypi.yml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
python-version: 3.9
|
python-version: 3.9
|
||||||
|
|
||||||
- name: Build a binary wheel and a source tarball
|
- name: Build a binary wheel and a source tarball
|
||||||
run: make build
|
run: make install && make build
|
||||||
|
|
||||||
- name: Release on PyPI
|
- name: Release on PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@master
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
This document records all notable changes to [HTTPie](https://httpie.io).
|
This document records all notable changes to [HTTPie](https://httpie.io).
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/).
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
||||||
|
|
||||||
|
## [3.2.1](https://github.com/httpie/httpie/compare/3.1.0...3.2.1) (2022-05-06)
|
||||||
|
|
||||||
|
- Improved support for determining auto-streaming when the `Content-Type` header includes encoding information. ([#1383](https://github.com/httpie/httpie/pull/1383))
|
||||||
|
- Fixed the display of the crash happening in the secondary process for update checks. ([#1388](https://github.com/httpie/httpie/issues/1388))
|
||||||
|
|
||||||
## [3.2.0](https://github.com/httpie/httpie/compare/3.1.0...3.2.0) (2022-05-05)
|
## [3.2.0](https://github.com/httpie/httpie/compare/3.1.0...3.2.0) (2022-05-05)
|
||||||
|
|
||||||
- Added a warning for notifying the user about the new updates. ([#1336](https://github.com/httpie/httpie/pull/1336))
|
- Added a warning for notifying the user about the new updates. ([#1336](https://github.com/httpie/httpie/pull/1336))
|
||||||
|
@ -59,8 +59,10 @@ $ git checkout -b my_topical_branch
|
|||||||
|
|
||||||
#### Setup
|
#### Setup
|
||||||
|
|
||||||
The [Makefile](https://github.com/httpie/httpie/blob/master/Makefile) contains a bunch of tasks to get you started. Just run
|
The [Makefile](https://github.com/httpie/httpie/blob/master/Makefile) contains a bunch of tasks to get you started.
|
||||||
the following command, which:
|
You can run `$ make` to see all the available tasks.
|
||||||
|
|
||||||
|
To get started, run the command below, which:
|
||||||
|
|
||||||
- Creates an isolated Python virtual environment inside `./venv`
|
- Creates an isolated Python virtual environment inside `./venv`
|
||||||
(via the standard library [venv](https://docs.python.org/3/library/venv.html) tool);
|
(via the standard library [venv](https://docs.python.org/3/library/venv.html) tool);
|
||||||
@ -70,7 +72,7 @@ the following command, which:
|
|||||||
- and runs tests (It is the same as running `make install test`).
|
- and runs tests (It is the same as running `make install test`).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ make
|
$ make all
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Python virtual environment
|
#### Python virtual environment
|
||||||
|
22
Makefile
22
Makefile
@ -22,6 +22,26 @@ VENV_PYTHON=$(VENV_BIN)/python
|
|||||||
export PATH := $(VENV_BIN):$(PATH)
|
export PATH := $(VENV_BIN):$(PATH)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
default: list-tasks
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Default task to get a list of tasks when `make' is run without args.
|
||||||
|
# <https://stackoverflow.com/questions/4219255>
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
list-tasks:
|
||||||
|
@echo Available tasks:
|
||||||
|
@echo ----------------
|
||||||
|
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
|
||||||
|
@echo
|
||||||
|
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Installation
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
all: uninstall-httpie install test
|
all: uninstall-httpie install test
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +53,7 @@ install-reqs:
|
|||||||
$(VENV_PIP) install --upgrade pip wheel build
|
$(VENV_PIP) install --upgrade pip wheel build
|
||||||
|
|
||||||
@echo $(H1)Installing dev requirements$(H1END)
|
@echo $(H1)Installing dev requirements$(H1END)
|
||||||
$(VENV_PIP) install --upgrade --editable '.[dev]'
|
$(VENV_PIP) install --upgrade '.[dev]' '.[test]'
|
||||||
|
|
||||||
@echo $(H1)Installing HTTPie$(H1END)
|
@echo $(H1)Installing HTTPie$(H1END)
|
||||||
$(VENV_PIP) install --upgrade --editable .
|
$(VENV_PIP) install --upgrade --editable .
|
||||||
|
@ -215,6 +215,21 @@ $ pacman -Syu httpie
|
|||||||
$ pacman -Syu
|
$ pacman -Syu
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Single binary executables
|
||||||
|
|
||||||
|
Get the standalone HTTPie Linux executables when you don't want to go through the full installation process
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Install httpie
|
||||||
|
$ https --download packages.httpie.io/binaries/linux/http-latest -o http
|
||||||
|
$ chmod +x ./http
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Upgrade httpie
|
||||||
|
$ https --download packages.httpie.io/binaries/linux/http-latest -o http
|
||||||
|
```
|
||||||
|
|
||||||
### FreeBSD
|
### FreeBSD
|
||||||
|
|
||||||
#### FreshPorts
|
#### FreshPorts
|
||||||
@ -2410,7 +2425,7 @@ You can check whether a new update is available for your system by running `http
|
|||||||
|
|
||||||
In the past `pip` was used to install/uninstall plugins, but on some environments (e.g., brew installed
|
In the past `pip` was used to install/uninstall plugins, but on some environments (e.g., brew installed
|
||||||
packages) it wasn’t working properly. The new interface is a very simple overlay on top of `pip` to allow
|
packages) it wasn’t working properly. The new interface is a very simple overlay on top of `pip` to allow
|
||||||
plugin installations on every installation method.
|
plugin installations on every installation method.
|
||||||
|
|
||||||
By default, the plugins (and their missing dependencies) will be stored under the configuration directory,
|
By default, the plugins (and their missing dependencies) will be stored under the configuration directory,
|
||||||
but this can be modified through `plugins_dir` variable on the config.
|
but this can be modified through `plugins_dir` variable on the config.
|
||||||
|
@ -17,11 +17,12 @@ docs-structure:
|
|||||||
Windows:
|
Windows:
|
||||||
- chocolatey
|
- chocolatey
|
||||||
Linux:
|
Linux:
|
||||||
- snap-linux
|
|
||||||
- brew-linux
|
|
||||||
- apt
|
- apt
|
||||||
- dnf
|
- dnf
|
||||||
- yum
|
- yum
|
||||||
|
- single-binary
|
||||||
|
- snap-linux
|
||||||
|
- brew-linux
|
||||||
- pacman
|
- pacman
|
||||||
FreeBSD:
|
FreeBSD:
|
||||||
- pkg
|
- pkg
|
||||||
@ -181,3 +182,16 @@ tools:
|
|||||||
- yum install httpie
|
- yum install httpie
|
||||||
upgrade:
|
upgrade:
|
||||||
- yum upgrade httpie
|
- yum upgrade httpie
|
||||||
|
|
||||||
|
single-binary:
|
||||||
|
title: Single binary executables
|
||||||
|
name: Single binary executables
|
||||||
|
note: Get the standalone HTTPie Linux executables when you don't want to go through the full installation process.
|
||||||
|
links:
|
||||||
|
commands:
|
||||||
|
install:
|
||||||
|
- https --download packages.httpie.io/binaries/linux/http-latest -o http
|
||||||
|
- ln -ls ./http ./https
|
||||||
|
- chmod +x ./http ./https
|
||||||
|
upgrade:
|
||||||
|
- https --download packages.httpie.io/binaries/linux/http-latest -o http
|
||||||
|
@ -22,7 +22,7 @@ If it is needed to be done manually, the following command can be used:
|
|||||||
$ brew bump-formula-pr httpie --version={TARGET_VERSION}
|
$ brew bump-formula-pr httpie --version={TARGET_VERSION}
|
||||||
```
|
```
|
||||||
|
|
||||||
which will bump the formala, and create a PR against the package index.
|
which will bump the formula, and create a PR against the package index.
|
||||||
|
|
||||||
## Hacking
|
## Hacking
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>httpie</id>
|
<id>httpie</id>
|
||||||
<version>3.1.0</version>
|
<version>3.2.1</version>
|
||||||
<summary>Modern, user-friendly command-line HTTP client for the API era</summary>
|
<summary>Modern, user-friendly command-line HTTP client for the API era</summary>
|
||||||
<description>
|
<description>
|
||||||
HTTPie *aitch-tee-tee-pie* is a user-friendly command-line HTTP client for the API era.
|
HTTPie *aitch-tee-tee-pie* is a user-friendly command-line HTTP client for the API era.
|
||||||
@ -33,7 +33,7 @@ Main features:
|
|||||||
<licenseUrl>https://raw.githubusercontent.com/httpie/httpie/master/LICENSE</licenseUrl>
|
<licenseUrl>https://raw.githubusercontent.com/httpie/httpie/master/LICENSE</licenseUrl>
|
||||||
<iconUrl>https://pie-assets.s3.eu-central-1.amazonaws.com/LogoIcons/GB.png</iconUrl>
|
<iconUrl>https://pie-assets.s3.eu-central-1.amazonaws.com/LogoIcons/GB.png</iconUrl>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<releaseNotes>See the [changelog](https://github.com/httpie/httpie/releases/tag/3.1.0).</releaseNotes>
|
<releaseNotes>See the [changelog](https://github.com/httpie/httpie/releases/tag/3.2.0).</releaseNotes>
|
||||||
<tags>httpie http https rest api client curl python ssl cli foss oss url</tags>
|
<tags>httpie http https rest api client curl python ssl cli foss oss url</tags>
|
||||||
<projectUrl>https://httpie.io</projectUrl>
|
<projectUrl>https://httpie.io</projectUrl>
|
||||||
<packageSourceUrl>https://github.com/httpie/httpie/tree/master/docs/packaging/windows-chocolatey</packageSourceUrl>
|
<packageSourceUrl>https://github.com/httpie/httpie/tree/master/docs/packaging/windows-chocolatey</packageSourceUrl>
|
||||||
|
@ -1,52 +1,24 @@
|
|||||||
function __fish_httpie_styles
|
function __fish_httpie_styles
|
||||||
echo "
|
printf '%s\n' abap algol algol_nu arduino auto autumn borland bw colorful default emacs friendly fruity gruvbox-dark gruvbox-light igor inkpot lovelace manni material monokai murphy native paraiso-dark paraiso-light pastie perldoc pie pie-dark pie-light rainbow_dash rrt sas solarized solarized-dark solarized-light stata stata-dark stata-light tango trac vim vs xcode zenburn
|
||||||
abap
|
end
|
||||||
algol
|
|
||||||
algol_nu
|
function __fish_httpie_mime_types
|
||||||
arduino
|
test -r /usr/share/mime/types && cat /usr/share/mime/types
|
||||||
auto
|
end
|
||||||
autumn
|
|
||||||
borland
|
function __fish_httpie_print_args
|
||||||
bw
|
set -l arg (commandline -t)
|
||||||
colorful
|
string match -qe H "$arg" || echo -e $arg"H\trequest headers"
|
||||||
default
|
string match -qe B "$arg" || echo -e $arg"B\trequest body"
|
||||||
emacs
|
string match -qe h "$arg" || echo -e $arg"h\tresponse headers"
|
||||||
friendly
|
string match -qe b "$arg" || echo -e $arg"b\tresponse body"
|
||||||
fruity
|
string match -qe m "$arg" || echo -e $arg"m\tresponse metadata"
|
||||||
gruvbox-dark
|
|
||||||
gruvbox-light
|
|
||||||
igor
|
|
||||||
inkpot
|
|
||||||
lovelace
|
|
||||||
manni
|
|
||||||
material
|
|
||||||
monokai
|
|
||||||
murphy
|
|
||||||
native
|
|
||||||
paraiso-dark
|
|
||||||
paraiso-light
|
|
||||||
pastie
|
|
||||||
perldoc
|
|
||||||
rainbow_dash
|
|
||||||
rrt
|
|
||||||
sas
|
|
||||||
solarized
|
|
||||||
solarized-dark
|
|
||||||
solarized-light
|
|
||||||
stata
|
|
||||||
stata-dark
|
|
||||||
stata-light
|
|
||||||
tango
|
|
||||||
trac
|
|
||||||
vim
|
|
||||||
vs
|
|
||||||
xcode
|
|
||||||
zenburn"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_httpie_auth_types
|
function __fish_httpie_auth_types
|
||||||
echo -e "basic\tBasic HTTP auth"
|
echo -e "basic\tBasic HTTP auth"
|
||||||
echo -e "digest\tDigest HTTP auth"
|
echo -e "digest\tDigest HTTP auth"
|
||||||
|
echo -e "bearer\tBearer HTTP Auth"
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_http_verify_options
|
function __fish_http_verify_options
|
||||||
@ -54,6 +26,7 @@ function __fish_http_verify_options
|
|||||||
echo -e "no\tDisable cert verification"
|
echo -e "no\tDisable cert verification"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Predefined Content Types
|
# Predefined Content Types
|
||||||
|
|
||||||
complete -c http -s j -l json -d 'Data items are serialized as a JSON object'
|
complete -c http -s j -l json -d 'Data items are serialized as a JSON object'
|
||||||
@ -70,26 +43,28 @@ complete -c http -s x -l compress -d 'Content compressed with Deflate algorithm'
|
|||||||
|
|
||||||
# Output Processing
|
# Output Processing
|
||||||
|
|
||||||
complete -c http -l pretty -xa "all colors format none" -d 'Controls output processing'
|
complete -c http -l pretty -xa "all colors format none" -d 'Controls output processing'
|
||||||
complete -c http -s s -l style -xa "(__fish_httpie_styles)" -d 'Output coloring style'
|
complete -c http -s s -l style -xa "(__fish_httpie_styles)" -d 'Output coloring style'
|
||||||
complete -c http -l unsorted -d 'Disables all sorting while formatting output'
|
complete -c http -l unsorted -d 'Disables all sorting while formatting output'
|
||||||
complete -c http -l sorted -d 'Re-enables all sorting options while formatting output'
|
complete -c http -l sorted -d 'Re-enables all sorting options while formatting output'
|
||||||
complete -c http -l format-options -x -d 'Controls output formatting'
|
complete -c http -l response-charset -x -d 'Override the response encoding'
|
||||||
|
complete -c http -l response-mime -xa "(__fish_httpie_mime_types)" -d 'Override the response mime type for coloring and formatting'
|
||||||
|
complete -c http -l format-options -x -d 'Controls output formatting'
|
||||||
|
|
||||||
|
|
||||||
# Output Options
|
# Output Options
|
||||||
|
|
||||||
complete -c http -s p -l print -x -d 'String specifying what the output should contain'
|
complete -c http -s p -l print -xa "(__fish_httpie_print_args)" -d 'String specifying what the output should contain'
|
||||||
complete -c http -s h -l headers -d 'Print only the response headers'
|
complete -c http -s h -l headers -d 'Print only the response headers'
|
||||||
complete -c http -s b -l body -d 'Print only the response body'
|
complete -c http -s m -l meta -d 'Print only the response metadata'
|
||||||
complete -c http -s v -l verbose -d 'Print the whole request as well as the response'
|
complete -c http -s b -l body -d 'Print only the response body'
|
||||||
complete -c http -l all -d 'Show any intermediary requests/responses'
|
complete -c http -s v -l verbose -d 'Print the whole request as well as the response'
|
||||||
complete -c http -s P -l history-print -x -d 'The same as --print but applies only to intermediary requests/responses'
|
complete -c http -l all -d 'Show any intermediary requests/responses'
|
||||||
complete -c http -s S -l stream -d 'Always stream the response body by line'
|
complete -c http -s S -l stream -d 'Always stream the response body by line'
|
||||||
complete -c http -s o -l output -F -d 'Save output to FILE'
|
complete -c http -s o -l output -F -d 'Save output to FILE'
|
||||||
complete -c http -s d -l download -d 'Download a file'
|
complete -c http -s d -l download -d 'Download a file'
|
||||||
complete -c http -s c -l continue -d 'Resume an interrupted download'
|
complete -c http -s c -l continue -d 'Resume an interrupted download'
|
||||||
complete -c http -s q -l quiet -d 'Do not print to stdout or stderr'
|
complete -c http -s q -l quiet -d 'Do not print to stdout or stderr'
|
||||||
|
|
||||||
|
|
||||||
# Sessions
|
# Sessions
|
||||||
@ -115,22 +90,24 @@ complete -c http -l max-headers -x -d 'Maximum number of response headers
|
|||||||
complete -c http -l timeout -x -d 'Connection timeout in seconds'
|
complete -c http -l timeout -x -d 'Connection timeout in seconds'
|
||||||
complete -c http -l check-status -d 'Error with non-200 HTTP status code'
|
complete -c http -l check-status -d 'Error with non-200 HTTP status code'
|
||||||
complete -c http -l path-as-is -d 'Bypass dot segment URL squashing'
|
complete -c http -l path-as-is -d 'Bypass dot segment URL squashing'
|
||||||
complete -c http -l chunked -d ''
|
complete -c http -l chunked -d 'Enable streaming via chunked transfer encoding'
|
||||||
|
|
||||||
|
|
||||||
# SSL
|
# SSL
|
||||||
|
|
||||||
complete -c http -l verify -xa "(__fish_http_verify_options)" -d 'Enable/disable cert verification'
|
complete -c http -l verify -xa "(__fish_http_verify_options)" -d 'Enable/disable cert verification'
|
||||||
complete -c http -l ssl -x -d 'Desired protocol version to use'
|
complete -c http -l ssl -x -d 'Desired protocol version to use'
|
||||||
complete -c http -l ciphers -x -d 'String in the OpenSSL cipher list format'
|
complete -c http -l ciphers -x -d 'String in the OpenSSL cipher list format'
|
||||||
complete -c http -l cert -F -d 'Client side SSL certificate'
|
complete -c http -l cert -F -d 'Client side SSL certificate'
|
||||||
complete -c http -l cert-key -F -d 'Private key to use with SSL'
|
complete -c http -l cert-key -F -d 'Private key to use with SSL'
|
||||||
|
complete -c http -l cert-key-pass -x -d 'Passphrase for the given private key'
|
||||||
|
|
||||||
|
|
||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
complete -c http -s I -l ignore-stdin -d 'Do not attempt to read stdin'
|
complete -c http -s I -l ignore-stdin -d 'Do not attempt to read stdin'
|
||||||
complete -c http -l help -d 'Show help'
|
complete -c http -l help -d 'Show help'
|
||||||
|
complete -c http -l manual -d 'Show the full manual'
|
||||||
complete -c http -l version -d 'Show version'
|
complete -c http -l version -d 'Show version'
|
||||||
complete -c http -l traceback -d 'Prints exception traceback should one occur'
|
complete -c http -l traceback -d 'Prints exception traceback should one occur'
|
||||||
complete -c http -l default-scheme -x -d 'The default scheme to use'
|
complete -c http -l default-scheme -x -d 'The default scheme to use'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" This file is auto-generated from the parser declaration in httpie/cli/definition.py by extras/scripts/generate_man_pages.py.
|
.\" This file is auto-generated from the parser declaration in httpie/cli/definition.py by extras/scripts/generate_man_pages.py.
|
||||||
.TH http 1 "2022-05-05" "HTTPie 3.2.0" "HTTPie Manual"
|
.TH http 1 "2022-05-06" "HTTPie 3.2.1" "HTTPie Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
http
|
http
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" This file is auto-generated from the parser declaration in httpie/manager/cli.py by extras/scripts/generate_man_pages.py.
|
.\" This file is auto-generated from the parser declaration in httpie/manager/cli.py by extras/scripts/generate_man_pages.py.
|
||||||
.TH httpie 1 "2022-05-05" "HTTPie 3.2.0" "HTTPie Manual"
|
.TH httpie 1 "2022-05-06" "HTTPie 3.2.1" "HTTPie Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
httpie
|
httpie
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" This file is auto-generated from the parser declaration in httpie/cli/definition.py by extras/scripts/generate_man_pages.py.
|
.\" This file is auto-generated from the parser declaration in httpie/cli/definition.py by extras/scripts/generate_man_pages.py.
|
||||||
.TH https 1 "2022-05-05" "HTTPie 3.2.0" "HTTPie Manual"
|
.TH https 1 "2022-05-06" "HTTPie 3.2.1" "HTTPie Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
https
|
https
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -6,6 +6,9 @@ from typing import Iterator, Tuple
|
|||||||
BUILD_DIR = Path(__file__).parent
|
BUILD_DIR = Path(__file__).parent
|
||||||
HTTPIE_DIR = BUILD_DIR.parent.parent.parent
|
HTTPIE_DIR = BUILD_DIR.parent.parent.parent
|
||||||
|
|
||||||
|
EXTRAS_DIR = HTTPIE_DIR / 'extras'
|
||||||
|
MAN_PAGES_DIR = EXTRAS_DIR / 'man'
|
||||||
|
|
||||||
SCRIPT_DIR = BUILD_DIR / Path('scripts')
|
SCRIPT_DIR = BUILD_DIR / Path('scripts')
|
||||||
HOOKS_DIR = SCRIPT_DIR / 'hooks'
|
HOOKS_DIR = SCRIPT_DIR / 'hooks'
|
||||||
|
|
||||||
@ -50,6 +53,11 @@ def build_packages(http_binary: Path, httpie_binary: Path) -> None:
|
|||||||
(http_binary, '/usr/bin/https'),
|
(http_binary, '/usr/bin/https'),
|
||||||
(httpie_binary, '/usr/bin/httpie'),
|
(httpie_binary, '/usr/bin/httpie'),
|
||||||
]
|
]
|
||||||
|
files.extend(
|
||||||
|
(man_page, f'/usr/share/man/man1/{man_page.name}')
|
||||||
|
for man_page in MAN_PAGES_DIR.glob('*.1')
|
||||||
|
)
|
||||||
|
|
||||||
# A list of additional dependencies
|
# A list of additional dependencies
|
||||||
deps = [
|
deps = [
|
||||||
'python3 >= 3.7',
|
'python3 >= 3.7',
|
||||||
|
@ -3,7 +3,7 @@ HTTPie: modern, user-friendly command-line HTTP client for the API era.
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '3.2.0'
|
__version__ = '3.2.1'
|
||||||
__date__ = '2022-05-05'
|
__date__ = '2022-05-06'
|
||||||
__author__ = 'Jakub Roztocil'
|
__author__ = 'Jakub Roztocil'
|
||||||
__licence__ = 'BSD'
|
__licence__ = 'BSD'
|
||||||
|
@ -132,10 +132,3 @@ class RequestType(enum.Enum):
|
|||||||
FORM = enum.auto()
|
FORM = enum.auto()
|
||||||
MULTIPART = enum.auto()
|
MULTIPART = enum.auto()
|
||||||
JSON = enum.auto()
|
JSON = enum.auto()
|
||||||
|
|
||||||
|
|
||||||
EMPTY_STRING = ''
|
|
||||||
OPEN_BRACKET = '['
|
|
||||||
CLOSE_BRACKET = ']'
|
|
||||||
BACKSLASH = '\\'
|
|
||||||
HIGHLIGHTER = '^'
|
|
||||||
|
@ -9,8 +9,14 @@ from typing import (
|
|||||||
Type,
|
Type,
|
||||||
Union,
|
Union,
|
||||||
)
|
)
|
||||||
from httpie.cli.dicts import NestedJSONArray
|
from .dicts import NestedJSONArray
|
||||||
from httpie.cli.constants import EMPTY_STRING, OPEN_BRACKET, CLOSE_BRACKET, BACKSLASH, HIGHLIGHTER
|
|
||||||
|
|
||||||
|
EMPTY_STRING = ''
|
||||||
|
HIGHLIGHTER = '^'
|
||||||
|
OPEN_BRACKET = '['
|
||||||
|
CLOSE_BRACKET = ']'
|
||||||
|
BACKSLASH = '\\'
|
||||||
|
|
||||||
|
|
||||||
class HTTPieSyntaxError(ValueError):
|
class HTTPieSyntaxError(ValueError):
|
||||||
@ -31,7 +37,7 @@ class HTTPieSyntaxError(ValueError):
|
|||||||
if self.token is not None:
|
if self.token is not None:
|
||||||
lines.append(self.source)
|
lines.append(self.source)
|
||||||
lines.append(
|
lines.append(
|
||||||
' ' * (self.token.start)
|
' ' * self.token.start
|
||||||
+ HIGHLIGHTER * (self.token.end - self.token.start)
|
+ HIGHLIGHTER * (self.token.end - self.token.start)
|
||||||
)
|
)
|
||||||
return '\n'.join(lines)
|
return '\n'.join(lines)
|
||||||
@ -51,9 +57,15 @@ class TokenKind(Enum):
|
|||||||
return 'a ' + self.name.lower()
|
return 'a ' + self.name.lower()
|
||||||
|
|
||||||
|
|
||||||
OPERATORS = {OPEN_BRACKET: TokenKind.LEFT_BRACKET, CLOSE_BRACKET: TokenKind.RIGHT_BRACKET}
|
OPERATORS = {
|
||||||
|
OPEN_BRACKET: TokenKind.LEFT_BRACKET,
|
||||||
|
CLOSE_BRACKET: TokenKind.RIGHT_BRACKET,
|
||||||
|
}
|
||||||
SPECIAL_CHARS = OPERATORS.keys() | {BACKSLASH}
|
SPECIAL_CHARS = OPERATORS.keys() | {BACKSLASH}
|
||||||
LITERAL_TOKENS = [TokenKind.TEXT, TokenKind.NUMBER]
|
LITERAL_TOKENS = [
|
||||||
|
TokenKind.TEXT,
|
||||||
|
TokenKind.NUMBER,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class Token(NamedTuple):
|
class Token(NamedTuple):
|
||||||
|
@ -13,7 +13,8 @@ import urllib3
|
|||||||
from . import __version__
|
from . import __version__
|
||||||
from .adapters import HTTPieHTTPAdapter
|
from .adapters import HTTPieHTTPAdapter
|
||||||
from .context import Environment
|
from .context import Environment
|
||||||
from .cli.constants import EMPTY_STRING, HTTP_OPTIONS
|
from .cli.constants import HTTP_OPTIONS
|
||||||
|
from .cli.nested_json import EMPTY_STRING
|
||||||
from .cli.dicts import HTTPHeadersDict, NestedJSONArray
|
from .cli.dicts import HTTPHeadersDict, NestedJSONArray
|
||||||
from .encoding import UTF8
|
from .encoding import UTF8
|
||||||
from .models import RequestsMessage
|
from .models import RequestsMessage
|
||||||
|
@ -3,7 +3,7 @@ from contextlib import redirect_stderr, redirect_stdout
|
|||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from httpie.context import Environment
|
from httpie.context import Environment
|
||||||
from httpie.internal.update_warnings import _fetch_updates
|
from httpie.internal.update_warnings import _fetch_updates, _get_suppress_context
|
||||||
from httpie.status import ExitStatus
|
from httpie.status import ExitStatus
|
||||||
|
|
||||||
STATUS_FILE = '.httpie-test-daemon-status'
|
STATUS_FILE = '.httpie-test-daemon-status'
|
||||||
@ -44,6 +44,7 @@ def run_daemon_task(env: Environment, args: List[str]) -> ExitStatus:
|
|||||||
assert options.daemon
|
assert options.daemon
|
||||||
assert options.task_id in DAEMONIZED_TASKS
|
assert options.task_id in DAEMONIZED_TASKS
|
||||||
with redirect_stdout(env.devnull), redirect_stderr(env.devnull):
|
with redirect_stdout(env.devnull), redirect_stderr(env.devnull):
|
||||||
DAEMONIZED_TASKS[options.task_id](env)
|
with _get_suppress_context(env):
|
||||||
|
DAEMONIZED_TASKS[options.task_id](env)
|
||||||
|
|
||||||
return ExitStatus.SUCCESS
|
return ExitStatus.SUCCESS
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
This module provides an interface to spawn a detached task to be
|
This module provides an interface to spawn a detached task to be
|
||||||
runned with httpie.internal.daemon_runner on a separate process. It is
|
run with httpie.internal.daemon_runner on a separate process. It is
|
||||||
based on DVC's daemon system.
|
based on DVC's daemon system.
|
||||||
https://github.com/iterative/dvc/blob/main/dvc/daemon.py
|
https://github.com/iterative/dvc/blob/main/dvc/daemon.py
|
||||||
"""
|
"""
|
||||||
@ -11,7 +11,7 @@ import platform
|
|||||||
import sys
|
import sys
|
||||||
import httpie.__main__
|
import httpie.__main__
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from subprocess import Popen
|
from subprocess import Popen, DEVNULL
|
||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
from httpie.compat import is_frozen, is_windows
|
from httpie.compat import is_frozen, is_windows
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ def _start_process(cmd: List[str], **kwargs) -> Popen:
|
|||||||
if not is_frozen:
|
if not is_frozen:
|
||||||
main_entrypoint = httpie.__main__.__file__
|
main_entrypoint = httpie.__main__.__file__
|
||||||
prefix += [main_entrypoint]
|
prefix += [main_entrypoint]
|
||||||
return Popen(prefix + cmd, close_fds=True, shell=False, **kwargs)
|
return Popen(prefix + cmd, close_fds=True, shell=False, stdout=DEVNULL, stderr=DEVNULL, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
def _spawn_windows(cmd: List[str], process_context: ProcessContext) -> None:
|
def _spawn_windows(cmd: List[str], process_context: ProcessContext) -> None:
|
||||||
|
@ -17,6 +17,7 @@ from .processing import Conversion, Formatting
|
|||||||
from .streams import (
|
from .streams import (
|
||||||
BaseStream, BufferedPrettyStream, EncodedStream, PrettyStream, RawStream,
|
BaseStream, BufferedPrettyStream, EncodedStream, PrettyStream, RawStream,
|
||||||
)
|
)
|
||||||
|
from ..utils import parse_content_type_header
|
||||||
|
|
||||||
|
|
||||||
MESSAGE_SEPARATOR = '\n\n'
|
MESSAGE_SEPARATOR = '\n\n'
|
||||||
@ -163,7 +164,10 @@ def get_stream_type_and_kwargs(
|
|||||||
if not is_stream and message_type is HTTPResponse:
|
if not is_stream and message_type is HTTPResponse:
|
||||||
# If this is a response, then check the headers for determining
|
# If this is a response, then check the headers for determining
|
||||||
# auto-streaming.
|
# auto-streaming.
|
||||||
is_stream = headers.get('Content-Type') == 'text/event-stream'
|
raw_content_type_header = headers.get('Content-Type', None)
|
||||||
|
if raw_content_type_header:
|
||||||
|
content_type_header, _ = parse_content_type_header(raw_content_type_header)
|
||||||
|
is_stream = (content_type_header == 'text/event-stream')
|
||||||
|
|
||||||
if not env.stdout_isatty and not prettify_groups:
|
if not env.stdout_isatty and not prettify_groups:
|
||||||
stream_class = RawStream
|
stream_class = RawStream
|
||||||
|
@ -277,7 +277,7 @@ def open_with_lockfile(file: Path, *args, **kwargs) -> Generator[IO[Any], None,
|
|||||||
target_file = Path(tempfile.gettempdir()) / file_id
|
target_file = Path(tempfile.gettempdir()) / file_id
|
||||||
|
|
||||||
# Have an atomic-like touch here, so we'll tighten the possibility of
|
# Have an atomic-like touch here, so we'll tighten the possibility of
|
||||||
# a race occuring between multiple processes accessing the same file.
|
# a race occurring between multiple processes accessing the same file.
|
||||||
try:
|
try:
|
||||||
target_file.touch(exist_ok=False)
|
target_file.touch(exist_ok=False)
|
||||||
except FileExistsError as exc:
|
except FileExistsError as exc:
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
"""Miscellaneous regression tests"""
|
"""Miscellaneous regression tests"""
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from httpie.cli.argtypes import KeyValueArgType
|
||||||
|
from httpie.cli.constants import SEPARATOR_HEADER, SEPARATOR_QUERY_PARAM, SEPARATOR_DATA_STRING
|
||||||
|
from httpie.cli.requestitems import RequestItems
|
||||||
from httpie.compat import is_windows
|
from httpie.compat import is_windows
|
||||||
from .utils.matching import assert_output_matches, Expect
|
|
||||||
from .utils import HTTP_OK, MockEnvironment, http
|
from .utils import HTTP_OK, MockEnvironment, http
|
||||||
|
from .utils.matching import assert_output_matches, Expect
|
||||||
|
|
||||||
|
|
||||||
def test_Host_header_overwrite(httpbin):
|
def test_Host_header_overwrite(httpbin):
|
||||||
@ -47,3 +50,21 @@ def test_verbose_redirected_stdout_separator(httpbin):
|
|||||||
Expect.RESPONSE_HEADERS,
|
Expect.RESPONSE_HEADERS,
|
||||||
Expect.BODY,
|
Expect.BODY,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(['separator', 'target'], [
|
||||||
|
(SEPARATOR_HEADER, 'headers'),
|
||||||
|
(SEPARATOR_QUERY_PARAM, 'params'),
|
||||||
|
(SEPARATOR_DATA_STRING, 'data'),
|
||||||
|
])
|
||||||
|
def test_initial_backslash_number(separator, target):
|
||||||
|
"""
|
||||||
|
<https://github.com/httpie/httpie/issues/1408>
|
||||||
|
"""
|
||||||
|
back_digit = r'\0'
|
||||||
|
raw_arg = back_digit + separator + back_digit
|
||||||
|
expected_parsed_data = {back_digit: back_digit}
|
||||||
|
parsed_arg = KeyValueArgType(separator)(raw_arg)
|
||||||
|
items = RequestItems.from_args([parsed_arg])
|
||||||
|
parsed_data = getattr(items, target)
|
||||||
|
assert parsed_data == expected_parsed_data
|
||||||
|
@ -124,6 +124,10 @@ def test_redirected_stream(httpbin):
|
|||||||
['Accept:text/event-stream'],
|
['Accept:text/event-stream'],
|
||||||
3
|
3
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
['Accept:text/event-stream; charset=utf-8'],
|
||||||
|
3
|
||||||
|
),
|
||||||
(
|
(
|
||||||
['Accept:text/plain'],
|
['Accept:text/plain'],
|
||||||
1
|
1
|
||||||
|
Reference in New Issue
Block a user