Requestfile
Human-friendly HTTP requests as plain text files.
Features
- Store HTTP requests as text files, with a familiar syntax
- Easily specify query arguments, headers, cookies, form data, and file uploads
- Include data from files
- Interpolate variables passed from the command line
- And more!
Usage
Requestfile can be used as either a command line tool, or as a library to use the format from third party tools.
Example
File request.txt:
POST http://httpbin.org/post
User-Agent: requestfile-example/0.1
%FIELD: username "user@example.com"
%FIELD: password "SuperSecret"
% requestfile send request.txt
{
"args": {},
"data": "",
"files": {},
"form": {
"password": "SuperSecret",
"username": "user@example.com"
},
"headers": {
"Accept-Encoding": "identity",
"Content-Length": "48",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "httpbin.org",
"User-Agent": "requestfile-example/0.1",
},
"json": null,
"origin": "68.516.160.290",
"url": "http://httpbin.org/post"
}
Quick overview
See SYNTAX.md for more details.
Commands to set query parameters, headers, cookies, form fields, multipart file uploads...
# Comments are ignored
POST http://example.com/signup
%PARAM: user_id "100"
%HEADER: x-auth-token <<EOF
th15-15-4-l0ng-s3cr3t-t0k3n
EOF
%COOKIE: session "eyJpZCI6MX0K"
%PARAM: username "admin"
%PARAM: password "TmljZSB0cnkK"|from-base64
%PART: picture <"profile-picture.png"
Passing arguments as variables
Variables can be used anywhere, and passed from the command line!
File request.txt:
# Edit a user's display name
%SET-DEFAULT: display_name "world"
POST "http://example.com/user/${user_id}"|interpolate
%HEADER: x-auth-token $auth_token
%FIELD: display_name $display_name
%FIELD: greeting "Hello, ${display_name}!"|interpolate
Fill in those variables from the command line:
requestfile send request.txt -a user_id=1 -a display_name="foobar"
Metadata
Release files for requestfile 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| requestfile-0.1.0.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| requestfile-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.6 kB
Release files / requestfile-0.1.0.tar.gz
| Download URL | requestfile-0.1.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d837b4d5b0afe3a41bbd5042c06e54dd2a33d73d35e38f4934f8bab2aab7eb08
|
|
BLAKE2b-256 checksum How to use checksums |
a1e931632eab71ffd6de9a493dd139415f4ad189a00c206a8f780c24738247ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|
Release files / requestfile-0.1.0-py3-none-any.whl
| Download URL | requestfile-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c6da7ee9424683a611a11bb3eb0b4febabd99d78cbd34732e88bdac5ff7ab99
|
|
BLAKE2b-256 checksum How to use checksums |
8c4ff0be635e5341690f47b6b5b5838c136e4dc40d7a79a471fbb643bb57d765
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.11
|