httpbinx 1.6.0__py3-none-any.whl → 1.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- httpbinx/__init__.py +1 -8
- httpbinx/cli.py +65 -0
- httpbinx/constants.py +3 -5
- httpbinx/helpers.py +22 -6
- httpbinx/main.py +6 -15
- httpbinx/meta.py +42 -45
- httpbinx/routers/anything.py +46 -3
- httpbinx/routers/images.py +10 -13
- httpbinx/static/bombs/bomb-1GB.br +0 -0
- httpbinx/static/bombs/bomb-1GB.gz +0 -0
- httpbinx/templates/moby.html +42 -10
- httpbinx/templates/sample.xml +9 -7
- httpbinx/templates/trackingscripts.html +13 -13
- httpbinx-1.8.0.dist-info/METADATA +113 -0
- {httpbinx-1.6.0.dist-info → httpbinx-1.8.0.dist-info}/RECORD +22 -22
- {httpbinx-1.6.0.dist-info → httpbinx-1.8.0.dist-info}/WHEEL +1 -2
- httpbinx-1.8.0.dist-info/entry_points.txt +5 -0
- httpbinx/VERSION +0 -1
- httpbinx/templates/index.html +0 -251
- httpbinx/utils.py +0 -15
- httpbinx-1.6.0.dist-info/METADATA +0 -86
- httpbinx-1.6.0.dist-info/top_level.txt +0 -1
- {httpbinx-1.6.0.dist-info → httpbinx-1.8.0.dist-info/licenses}/LICENSE +0 -0
httpbinx/__init__.py
CHANGED
@@ -1,12 +1,5 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# flake8: noqa
|
3
|
-
import pkgutil
|
4
|
-
|
5
1
|
from .main import app
|
6
2
|
|
7
|
-
__version__ =
|
8
|
-
version_info = tuple(int(v) if v.isdigit() else v for v in __version__.split('.'))
|
9
|
-
|
10
|
-
del pkgutil
|
3
|
+
__version__ = '1.8.0'
|
11
4
|
|
12
5
|
app.version = __version__
|
httpbinx/cli.py
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
"""httpbinx"""
|
2
|
+
|
3
|
+
import argparse
|
4
|
+
|
5
|
+
import httpbinx
|
6
|
+
|
7
|
+
|
8
|
+
def version(args):
|
9
|
+
# TODO
|
10
|
+
print(httpbinx.__version__)
|
11
|
+
|
12
|
+
|
13
|
+
def info(args):
|
14
|
+
# TODO
|
15
|
+
pass
|
16
|
+
|
17
|
+
|
18
|
+
def server(args):
|
19
|
+
"""Start the httpbinx server"""
|
20
|
+
import uvicorn
|
21
|
+
uvicorn.run(
|
22
|
+
'httpbinx.main:app',
|
23
|
+
host=args.host,
|
24
|
+
port=args.port
|
25
|
+
)
|
26
|
+
|
27
|
+
|
28
|
+
def execute():
|
29
|
+
parser = argparse.ArgumentParser(
|
30
|
+
prog='httpbinx',
|
31
|
+
description='httpbinx is a fastapi server for testing.'
|
32
|
+
)
|
33
|
+
parser.add_argument('--version', action='version', version='%(prog)s 1.0')
|
34
|
+
subparsers = parser.add_subparsers(dest='command')
|
35
|
+
# version
|
36
|
+
parser_version = subparsers.add_parser('version', help='show version')
|
37
|
+
parser_version.set_defaults(func=version)
|
38
|
+
# info
|
39
|
+
parser_info = subparsers.add_parser('info', help='show info')
|
40
|
+
parser_info.set_defaults(func=info)
|
41
|
+
# server
|
42
|
+
parser_server = subparsers.add_parser('server', help='start server')
|
43
|
+
parser_server.set_defaults(func=server)
|
44
|
+
parser_server.add_argument(
|
45
|
+
'--host',
|
46
|
+
type=str,
|
47
|
+
help='host',
|
48
|
+
default='0.0.0.0'
|
49
|
+
)
|
50
|
+
parser_server.add_argument(
|
51
|
+
'--port',
|
52
|
+
type=int,
|
53
|
+
help='port',
|
54
|
+
default=80
|
55
|
+
)
|
56
|
+
|
57
|
+
parse_args = parser.parse_args()
|
58
|
+
if hasattr(parse_args, 'func'):
|
59
|
+
parse_args.func(parse_args)
|
60
|
+
else:
|
61
|
+
parser.print_help()
|
62
|
+
|
63
|
+
|
64
|
+
if __name__ == '__main__':
|
65
|
+
execute()
|
httpbinx/constants.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# flake8: noqa
|
3
1
|
REDIRECT_LOCATION = '/redirect/1'
|
4
2
|
|
5
3
|
ACCEPTED_MEDIA_TYPES = [
|
@@ -27,9 +25,9 @@ ASCII_ART = """
|
|
27
25
|
_...._
|
28
26
|
.' _ _ `.
|
29
27
|
| ."` ^ `". _,
|
30
|
-
|
28
|
+
\\_;`"---"`|//
|
31
29
|
| ;/
|
32
|
-
|
30
|
+
\\_ _/
|
33
31
|
`\"\"\"`
|
34
32
|
"""
|
35
33
|
|
@@ -40,7 +38,7 @@ ANGRY_ASCII = """
|
|
40
38
|
: :
|
41
39
|
| |
|
42
40
|
: __ :
|
43
|
-
|
41
|
+
\\ .-"` `"-. /
|
44
42
|
'. .'
|
45
43
|
'-......-'
|
46
44
|
YOU SHOULDN'T BE HERE
|
httpbinx/helpers.py
CHANGED
@@ -1,21 +1,23 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
1
|
import json
|
3
2
|
import random
|
4
3
|
import re
|
4
|
+
from pathlib import Path
|
5
5
|
|
6
6
|
from starlette import status
|
7
7
|
from starlette.requests import Request
|
8
8
|
from starlette.responses import Response
|
9
9
|
from starlette.templating import Jinja2Templates
|
10
10
|
|
11
|
-
from httpbinx.constants import ACCEPTED_MEDIA_TYPES
|
12
|
-
|
13
|
-
from httpbinx.
|
14
|
-
from httpbinx.schemas import RequestAttrs
|
15
|
-
from httpbinx.schemas import RequestInfo
|
11
|
+
from httpbinx.constants import (ACCEPTED_MEDIA_TYPES, ASCII_ART,
|
12
|
+
REDIRECT_LOCATION)
|
13
|
+
from httpbinx.schemas import RequestAttrs, RequestInfo
|
16
14
|
|
17
15
|
# init Jinja2
|
18
16
|
_templates = Jinja2Templates(directory='templates')
|
17
|
+
# image path
|
18
|
+
_images_path = Path(__file__).parent / 'static' / 'images'
|
19
|
+
# bomb files path
|
20
|
+
_bomb_files_path = Path(__file__).parent / 'static' / 'bombs'
|
19
21
|
|
20
22
|
|
21
23
|
def get_templates() -> Jinja2Templates:
|
@@ -23,6 +25,20 @@ def get_templates() -> Jinja2Templates:
|
|
23
25
|
return _templates
|
24
26
|
|
25
27
|
|
28
|
+
def get_images_path() -> Path:
|
29
|
+
"""Dependency function that returns the path to the images directory"""
|
30
|
+
if not _images_path.exists():
|
31
|
+
raise FileNotFoundError(f'{_images_path} does not exist.')
|
32
|
+
return _images_path
|
33
|
+
|
34
|
+
|
35
|
+
def get_bomb_file_path() -> Path:
|
36
|
+
"""Dependency function that returns the path to the bomb files directory"""
|
37
|
+
if not _bomb_files_path.exists():
|
38
|
+
raise FileNotFoundError(f'{_bomb_files_path} does not exist.')
|
39
|
+
return _bomb_files_path
|
40
|
+
|
41
|
+
|
26
42
|
async def to_request_info(request: Request, **extras) -> RequestInfo:
|
27
43
|
"""Returns model RequestInfo instance"""
|
28
44
|
await request.body() # Note: Execute `.stream()` only once.
|
httpbinx/main.py
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
|
2
|
-
from os import path
|
1
|
+
from pathlib import Path
|
3
2
|
|
4
3
|
from fastapi import FastAPI
|
5
4
|
from fastapi.staticfiles import StaticFiles
|
6
|
-
from starlette.middleware.cors import CORSMiddleware
|
7
5
|
|
8
|
-
from httpbinx.meta import
|
6
|
+
from httpbinx.meta import get_tags_metadata
|
9
7
|
from httpbinx.routers import router
|
10
8
|
|
11
9
|
app = FastAPI(
|
@@ -14,22 +12,15 @@ app = FastAPI(
|
|
14
12
|
'written in Python + FastAPI.',
|
15
13
|
docs_url='/', # swagger docs page url
|
16
14
|
swagger_ui_parameters={'docExpansion': 'none'},
|
17
|
-
openapi_tags=
|
15
|
+
openapi_tags=get_tags_metadata()
|
18
16
|
)
|
19
17
|
|
18
|
+
# mount static files
|
19
|
+
static_dir = Path(__file__).parent / 'static'
|
20
20
|
app.mount(
|
21
21
|
'/static',
|
22
|
-
StaticFiles(directory=
|
22
|
+
StaticFiles(directory=static_dir),
|
23
23
|
name='static'
|
24
24
|
)
|
25
25
|
|
26
|
-
app.add_middleware(
|
27
|
-
CORSMiddleware,
|
28
|
-
allow_origins=['*'],
|
29
|
-
allow_credentials=True,
|
30
|
-
allow_methods=['*'],
|
31
|
-
allow_headers=['*'],
|
32
|
-
)
|
33
|
-
|
34
|
-
# app.openapi_tags = []
|
35
26
|
app.include_router(router=router)
|
httpbinx/meta.py
CHANGED
@@ -1,45 +1,42 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
'
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
'
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
'description': 'Returns anything that is passed to request',
|
44
|
-
}
|
45
|
-
]
|
1
|
+
"""
|
2
|
+
This module defines the metadata for API tags used in the FastAPI application.
|
3
|
+
These tags are used to organize and categorize different endpoints in the API documentation.
|
4
|
+
"""
|
5
|
+
from functools import lru_cache
|
6
|
+
from typing import List
|
7
|
+
|
8
|
+
from pydantic import BaseModel, Field
|
9
|
+
|
10
|
+
|
11
|
+
class Tag(BaseModel):
|
12
|
+
name: str = Field(..., description='The name of the tag')
|
13
|
+
description: str = Field(..., description='A brief description of the tag')
|
14
|
+
|
15
|
+
|
16
|
+
class TagsMetadata(BaseModel):
|
17
|
+
tags: List[Tag] = Field(..., description='List of API tags')
|
18
|
+
|
19
|
+
|
20
|
+
TAGS_METADATA = TagsMetadata(
|
21
|
+
tags=[
|
22
|
+
Tag(name='HTTP Methods', description='Testing different HTTP verbs'),
|
23
|
+
Tag(name='Auth', description='Auth methods'),
|
24
|
+
Tag(name='Status codes', description='Generates responses with given status code'),
|
25
|
+
Tag(name='Request inspection', description='Inspect the request data'),
|
26
|
+
Tag(name='Response inspection', description='Inspect the response data like caching and headers'),
|
27
|
+
Tag(name='Response formats', description='Returns responses in different data formats'),
|
28
|
+
Tag(name='Dynamic data', description='Generates random and dynamic data'),
|
29
|
+
Tag(name='Cookies', description='Creates, reads and deletes Cookies'),
|
30
|
+
Tag(name='Images', description='Returns different image formats'),
|
31
|
+
Tag(name='Redirects', description='Returns different redirect responses'),
|
32
|
+
Tag(name='Anything', description='Returns anything that is passed to request'),
|
33
|
+
]
|
34
|
+
)
|
35
|
+
|
36
|
+
|
37
|
+
@lru_cache
|
38
|
+
def get_tags_metadata() -> List[dict]:
|
39
|
+
"""
|
40
|
+
Returns the tags metadata in the format expected by FastAPI.
|
41
|
+
"""
|
42
|
+
return [tag.model_dump() for tag in TAGS_METADATA.tags]
|
httpbinx/routers/anything.py
CHANGED
@@ -1,13 +1,25 @@
|
|
1
|
-
|
2
|
-
from
|
1
|
+
from enum import Enum
|
2
|
+
from os import path
|
3
|
+
|
4
|
+
from fastapi import APIRouter, Path
|
3
5
|
from starlette.requests import Request
|
6
|
+
from starlette.responses import FileResponse
|
4
7
|
|
5
|
-
from httpbinx.helpers import to_request_info
|
8
|
+
from httpbinx.helpers import get_bomb_file_path, to_request_info
|
6
9
|
from httpbinx.schemas import RequestInfo
|
7
10
|
|
8
11
|
router = APIRouter(tags=['Anything'])
|
9
12
|
|
10
13
|
|
14
|
+
class BombTypes(str, Enum):
|
15
|
+
"""The allowed bomb file compression types are: brotli and gzip."""
|
16
|
+
brotli = 'brotli'
|
17
|
+
gzip = 'gzip'
|
18
|
+
|
19
|
+
|
20
|
+
bombs_path: Path = get_bomb_file_path()
|
21
|
+
|
22
|
+
|
11
23
|
@router.api_route(
|
12
24
|
'/anything', # TODO path regex
|
13
25
|
response_model=RequestInfo,
|
@@ -17,3 +29,34 @@ router = APIRouter(tags=['Anything'])
|
|
17
29
|
)
|
18
30
|
async def anything(request: Request):
|
19
31
|
return await to_request_info(request)
|
32
|
+
|
33
|
+
|
34
|
+
@router.get(
|
35
|
+
'/bombs/{file}',
|
36
|
+
response_class=FileResponse,
|
37
|
+
summary='Returns a bomb file.',
|
38
|
+
description='**It may cause your client to crash! '
|
39
|
+
'References [I use Zip Bombs to Protect my Server](https://idiallo.com/blog/zipbomb-protection)**',
|
40
|
+
response_description='Return a bomb for compressed files.'
|
41
|
+
)
|
42
|
+
async def bomb_file(
|
43
|
+
*,
|
44
|
+
file: BombTypes = Path(
|
45
|
+
...,
|
46
|
+
title='Compression types',
|
47
|
+
description='The allowed bomb file compression types',
|
48
|
+
)
|
49
|
+
):
|
50
|
+
if file == BombTypes.gzip:
|
51
|
+
# dd if=/dev/zero bs=1M count=1000 | gzip -c > bomb-1GB.gz
|
52
|
+
return FileResponse(
|
53
|
+
path=path.join(bombs_path, 'bomb-1GB.gz'),
|
54
|
+
headers={'Content-Encoding': 'gzip'},
|
55
|
+
)
|
56
|
+
elif file == BombTypes.brotli:
|
57
|
+
# dd if=/dev/zero bs=1M count=1000 | brotli > bomb-1GB.br
|
58
|
+
return FileResponse(
|
59
|
+
path=path.join(bombs_path, 'bomb-1GB.br'),
|
60
|
+
headers={'Content-Encoding': 'br'},
|
61
|
+
)
|
62
|
+
raise ValueError(f'{file} is not a valid file type.')
|
httpbinx/routers/images.py
CHANGED
@@ -1,21 +1,20 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
1
|
"""Images"""
|
3
|
-
from
|
2
|
+
from pathlib import Path
|
4
3
|
|
5
4
|
from fastapi import APIRouter
|
6
5
|
from starlette.requests import Request
|
7
6
|
from starlette.responses import FileResponse
|
8
7
|
from starlette.status import HTTP_406_NOT_ACCEPTABLE
|
9
8
|
|
10
|
-
from httpbinx.helpers import status_code_response
|
9
|
+
from httpbinx.helpers import get_images_path, status_code_response
|
11
10
|
|
12
11
|
|
13
12
|
class ImageResponse(FileResponse):
|
14
13
|
"""set response headers Content-Type: image/* """
|
15
|
-
media_type = 'image/*'
|
14
|
+
media_type = 'image/*' # default
|
16
15
|
|
17
16
|
|
18
|
-
images_path =
|
17
|
+
images_path: Path = get_images_path()
|
19
18
|
|
20
19
|
router = APIRouter(
|
21
20
|
tags=['Images'],
|
@@ -32,9 +31,6 @@ router = APIRouter(
|
|
32
31
|
)
|
33
32
|
async def image(request: Request):
|
34
33
|
accept = request.headers.get('accept')
|
35
|
-
if not accept:
|
36
|
-
# Default media type to png
|
37
|
-
return await image_png()
|
38
34
|
accept = accept.lower()
|
39
35
|
if 'image/webp' in accept:
|
40
36
|
return await image_webp()
|
@@ -42,7 +38,8 @@ async def image(request: Request):
|
|
42
38
|
return await image_svg()
|
43
39
|
elif 'image/jpeg' in accept:
|
44
40
|
return await image_jpeg()
|
45
|
-
elif
|
41
|
+
elif any(x in accept for x in ['image/png', 'image/*', '*/*']):
|
42
|
+
# Default media type to png
|
46
43
|
return await image_png()
|
47
44
|
else:
|
48
45
|
return status_code_response(HTTP_406_NOT_ACCEPTABLE)
|
@@ -55,7 +52,7 @@ async def image(request: Request):
|
|
55
52
|
response_description='A PNG image.'
|
56
53
|
)
|
57
54
|
async def image_png():
|
58
|
-
return ImageResponse(path=
|
55
|
+
return ImageResponse(path=images_path / 'pig_icon.png')
|
59
56
|
|
60
57
|
|
61
58
|
@router.get(
|
@@ -65,7 +62,7 @@ async def image_png():
|
|
65
62
|
response_description='A JPEG image.'
|
66
63
|
)
|
67
64
|
async def image_jpeg():
|
68
|
-
return ImageResponse(path=
|
65
|
+
return ImageResponse(path=images_path / 'jackal.jpg')
|
69
66
|
|
70
67
|
|
71
68
|
@router.get(
|
@@ -75,7 +72,7 @@ async def image_jpeg():
|
|
75
72
|
response_description='A WEBP image.'
|
76
73
|
)
|
77
74
|
async def image_webp():
|
78
|
-
return ImageResponse(path=
|
75
|
+
return ImageResponse(path=images_path / 'wolf_1.webp')
|
79
76
|
|
80
77
|
|
81
78
|
@router.get(
|
@@ -85,4 +82,4 @@ async def image_webp():
|
|
85
82
|
response_description='An SVG image.'
|
86
83
|
)
|
87
84
|
async def image_svg():
|
88
|
-
return ImageResponse(path=
|
85
|
+
return ImageResponse(path=images_path / 'svg_logo.svg')
|
Binary file
|
Binary file
|
httpbinx/templates/moby.html
CHANGED
@@ -1,14 +1,46 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
<head>
|
4
|
+
</head>
|
5
|
+
<body>
|
6
|
+
<h1>Herman Melville - Moby-Dick</h1>
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
<div>
|
9
|
+
<p>
|
10
|
+
Availing himself of the mild, summer-cool weather that now reigned in these latitudes, and in preparation for
|
11
|
+
the peculiarly active pursuits shortly to be anticipated, Perth, the begrimed, blistered old blacksmith, had not
|
12
|
+
removed his portable forge to the hold again, after concluding his contributory work for Ahab's leg, but still
|
13
|
+
retained it on deck, fast lashed to ringbolts by the foremast; being now almost incessantly invoked by the
|
14
|
+
headsmen, and harpooneers, and bowsmen to do some little job for them; altering, or repairing, or new shaping
|
15
|
+
their various weapons and boat furniture. Often he would be surrounded by an eager circle, all waiting to be
|
16
|
+
served; holding boat-spades, pike-heads, harpoons, and lances, and jealously watching his every sooty movement,
|
17
|
+
as he toiled. Nevertheless, this old man's was a patient hammer wielded by a patient arm. No murmur, no
|
18
|
+
impatience, no petulance did come from him. Silent, slow, and solemn; bowing over still further his chronically
|
19
|
+
broken back, he toiled away, as if toil were life itself, and the heavy beating of his hammer the heavy beating
|
20
|
+
of his heart. And so it was.—Most miserable! A peculiar walk in this old man, a certain slight but painful
|
21
|
+
appearing yawing in his gait, had at an early period of the voyage excited the curiosity of the mariners. And to
|
22
|
+
the importunity of their persisted questionings he had finally given in; and so it came to pass that every one
|
23
|
+
now knew the shameful story of his wretched fate. Belated, and not innocently, one bitter winter's midnight, on
|
24
|
+
the road running between two country towns, the blacksmith half-stupidly felt the deadly numbness stealing over
|
25
|
+
him, and sought refuge in a leaning, dilapidated barn. The issue was, the loss of the extremities of both feet.
|
26
|
+
Out of this revelation, part by part, at last came out the four acts of the gladness, and the one long, and as
|
27
|
+
yet uncatastrophied fifth act of the grief of his life's drama. He was an old man, who, at the age of nearly
|
28
|
+
sixty, had postponedly encountered that thing in sorrow's technicals called ruin. He had been an artisan of
|
29
|
+
famed excellence, and with plenty to do; owned a house and garden; embraced a youthful, daughter-like, loving
|
30
|
+
wife, and three blithe, ruddy children; every Sunday went to a cheerful-looking church, planted in a grove. But
|
31
|
+
one night, under cover of darkness, and further concealed in a most cunning disguisement, a desperate burglar
|
32
|
+
slid into his happy home, and robbed them all of everything. And darker yet to tell, the blacksmith himself did
|
33
|
+
ignorantly conduct this burglar into his family's heart. It was the Bottle Conjuror! Upon the opening of that
|
34
|
+
fatal cork, forth flew the fiend, and shrivelled up his home. Now, for prudent, most wise, and economic reasons,
|
35
|
+
the blacksmith's shop was in the basement of his dwelling, but with a separate entrance to it; so that always
|
36
|
+
had the young and loving healthy wife listened with no unhappy nervousness, but with vigorous pleasure, to the
|
37
|
+
stout ringing of her young-armed old husband's hammer; whose reverberations, muffled by passing through the
|
38
|
+
floors and walls, came up to her, not unsweetly, in her nursery; and so, to stout Labor's iron lullaby, the
|
39
|
+
blacksmith's infants were rocked to slumber. Oh, woe on woe! Oh, Death, why canst thou not sometimes be timely?
|
40
|
+
Hadst thou taken this old blacksmith to thyself ere his full ruin came upon him, then had the young widow had a
|
41
|
+
delicious grief, and her orphans a truly venerable, legendary sire to dream of in their after years; and all of
|
42
|
+
them a care-killing competency.
|
43
|
+
</p>
|
44
|
+
</div>
|
45
|
+
</body>
|
14
46
|
</html>
|
httpbinx/templates/sample.xml
CHANGED
@@ -3,22 +3,24 @@
|
|
3
3
|
<!-- A SAMPLE set of slides -->
|
4
4
|
|
5
5
|
<slideshow
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
title="Sample Slide Show"
|
7
|
+
date="Date of publication"
|
8
|
+
author="Yours Truly"
|
9
|
+
>
|
10
10
|
|
11
11
|
<!-- TITLE SLIDE -->
|
12
12
|
<slide type="all">
|
13
|
-
|
13
|
+
<title>Wake up to WonderWidgets!</title>
|
14
14
|
</slide>
|
15
15
|
|
16
16
|
<!-- OVERVIEW -->
|
17
17
|
<slide type="all">
|
18
18
|
<title>Overview</title>
|
19
|
-
<item>Why <em>WonderWidgets</em> are great
|
19
|
+
<item>Why <em>WonderWidgets</em> are great
|
20
|
+
</item>
|
20
21
|
<item/>
|
21
|
-
<item>Who <em>buys</em> WonderWidgets
|
22
|
+
<item>Who <em>buys</em> WonderWidgets
|
23
|
+
</item>
|
22
24
|
</slide>
|
23
25
|
|
24
26
|
</slideshow>
|
@@ -1,18 +1,18 @@
|
|
1
1
|
{#
|
2
|
-
|
2
|
+
place tracking scripts (like Google Analytics) here
|
3
3
|
#}
|
4
4
|
|
5
5
|
<script type="text/javascript">
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
const _gauges = _gauges || [];
|
7
|
+
(function () {
|
8
|
+
const t = document.createElement('script');
|
9
|
+
t.type = 'text/javascript';
|
10
|
+
t.async = true;
|
11
|
+
t.id = 'gauges-tracker';
|
12
|
+
t.setAttribute('data-site-id', '58cb2e71c88d9043ac01d000');
|
13
|
+
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
|
14
|
+
t.src = 'https://d36ee2fcip1434.cloudfront.net/track.js';
|
15
|
+
const s = document.getElementsByTagName('script')[0];
|
16
|
+
s.parentNode.insertBefore(t, s);
|
17
|
+
})();
|
18
18
|
</script>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: httpbinx
|
3
|
+
Version: 1.8.0
|
4
|
+
Summary: HTTP Request & Response Service, written in Python + FastAPI.
|
5
|
+
Author-Email: Leo <imleowoo@outlook.com>
|
6
|
+
Maintainer-Email: Leo <imleowoo@outlook.com>
|
7
|
+
License: MIT License
|
8
|
+
|
9
|
+
Copyright (c) 2021 Leo
|
10
|
+
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
13
|
+
in the Software without restriction, including without limitation the rights
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
16
|
+
furnished to do so, subject to the following conditions:
|
17
|
+
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
19
|
+
copies or substantial portions of the Software.
|
20
|
+
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
27
|
+
SOFTWARE.
|
28
|
+
|
29
|
+
Classifier: Programming Language :: Python
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
31
|
+
Classifier: Programming Language :: Python :: 3.8
|
32
|
+
Classifier: Programming Language :: Python :: 3.9
|
33
|
+
Classifier: Programming Language :: Python :: 3.10
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
37
|
+
Project-URL: Homepage, https://github.com/imleowoo/httpbinx
|
38
|
+
Project-URL: Repository, https://github.com/imleowoo/httpbinx
|
39
|
+
Requires-Python: >=3.8
|
40
|
+
Requires-Dist: fastapi
|
41
|
+
Requires-Dist: uvicorn
|
42
|
+
Requires-Dist: starlette
|
43
|
+
Requires-Dist: jinja2
|
44
|
+
Requires-Dist: brotli
|
45
|
+
Requires-Dist: python-multipart
|
46
|
+
Provides-Extra: test
|
47
|
+
Requires-Dist: httpx; extra == "test"
|
48
|
+
Requires-Dist: pytest-cov; extra == "test"
|
49
|
+
Requires-Dist: pytest-mock; extra == "test"
|
50
|
+
Requires-Dist: pytest-xdist; extra == "test"
|
51
|
+
Requires-Dist: pytest; extra == "test"
|
52
|
+
Description-Content-Type: text/markdown
|
53
|
+
|
54
|
+
](https://raw.githubusercontent.com/imleowoo/httpbinx/main/httpbinx/static/images/httpbinx_cover.png)
|
55
|
+
|
56
|
+
[](https://github.com/postmanlabs/httpbin)
|
57
|
+

|
58
|
+
|
59
|
+
# httpbinx
|
60
|
+
|
61
|
+
HTTP Request & Response Service, written in Python + FastAPI.
|
62
|
+
|
63
|
+
## Deployed at:
|
64
|
+
|
65
|
+
- **https://httpbinx.wooe.cc**
|
66
|
+
|
67
|
+
## Reference Project
|
68
|
+
|
69
|
+
A [Kenneth Reitz](http://kennethreitz.org/bitcoin) Project. See https://github.com/postmanlabs/httpbin
|
70
|
+
|
71
|
+
## Quick Start
|
72
|
+
|
73
|
+
## Installation
|
74
|
+
|
75
|
+
### PyPI
|
76
|
+
|
77
|
+
**[httpbinx](https://pypi.org/project/httpbinx/)** is available on PyPI
|
78
|
+
|
79
|
+
```shell
|
80
|
+
$ pip install httpbinx
|
81
|
+
```
|
82
|
+
|
83
|
+
### Source Code
|
84
|
+
|
85
|
+
```shell
|
86
|
+
$ git clone https://github.com/imleowoo/httpbinx.git
|
87
|
+
$ python setup.py install # or `pip install .`
|
88
|
+
```
|
89
|
+
|
90
|
+
## Run it
|
91
|
+
|
92
|
+
### Run directly
|
93
|
+
|
94
|
+
```shell
|
95
|
+
$ httpbinx server --host=0.0.0.0 --port=80
|
96
|
+
```
|
97
|
+
|
98
|
+
### Run with Docker
|
99
|
+
|
100
|
+
```shell
|
101
|
+
$ docker pull leowoo/httpbinx:latest
|
102
|
+
$ docker run -p 80:80 --name httpbinx leowoo/httpbinx:latest
|
103
|
+
```
|
104
|
+
|
105
|
+
### It starts running
|
106
|
+
|
107
|
+
```text
|
108
|
+
INFO: Started server process [17044]
|
109
|
+
INFO: Waiting for application startup.
|
110
|
+
INFO: Application startup complete.
|
111
|
+
INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
|
112
|
+
...
|
113
|
+
```
|
@@ -1,26 +1,31 @@
|
|
1
|
-
httpbinx/
|
2
|
-
httpbinx/
|
3
|
-
httpbinx/
|
4
|
-
httpbinx/
|
5
|
-
httpbinx/
|
6
|
-
httpbinx/
|
7
|
-
httpbinx/
|
8
|
-
httpbinx/utils.py,sha256=kMVB5ORarUJj6MdySbb8utCbgyM2WbitSmiDYBAFnSs,464
|
1
|
+
httpbinx-1.8.0.dist-info/METADATA,sha256=4ssX6hl1ANVFBLDBariGV7nvlc_q-Q55p9wWnZc7QVY,3780
|
2
|
+
httpbinx-1.8.0.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
httpbinx-1.8.0.dist-info/entry_points.txt,sha256=sRkqxXJlZzL_lyEEQOecT_wue4JP64lYhpLwrPCZ-lI,66
|
4
|
+
httpbinx-1.8.0.dist-info/licenses/LICENSE,sha256=t6oZPzEcm1CsBu9sB_8JYTc5rSOUhyQUee5qvAg4o-A,1060
|
5
|
+
httpbinx/__init__.py,sha256=BtFN03iQf37ecI8AikkuZ6MbBZuBEEcONvB73NCN2Hg,72
|
6
|
+
httpbinx/cli.py,sha256=bMPWV5HbOzqNJr3HBqFsZkaFqLI5YJneQQpAzF66mOg,1417
|
7
|
+
httpbinx/constants.py,sha256=kXeT_Yzl_-4SJT_a7RxU5dfXBTe4-b1Zg8TBF-8AGbs,870
|
9
8
|
httpbinx/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
+
httpbinx/helpers.py,sha256=VVwjLpEKxi_awEPqbgb8tfWnhJEHSQFTsthE0pBKgp4,4373
|
10
|
+
httpbinx/main.py,sha256=kq8pcewugwiInkB8Cf0MvyAKJaK9uoMEeBHB5_xaprk,639
|
11
|
+
httpbinx/meta.py,sha256=h6scAO050bHFiy7UG2Q8MsyJsAHWMsZAFmZntdUwTAs,1699
|
10
12
|
httpbinx/routers/__init__.py,sha256=xwbZGA3-sV07HCPAly8o5uUJGbdKH3pBHUakXEjvRK4,1409
|
11
|
-
httpbinx/routers/anything.py,sha256=
|
13
|
+
httpbinx/routers/anything.py,sha256=_FK1D9xEONlVIF_rvlqe_tBSsmG7ba8K_m-kGFotWWg,1923
|
12
14
|
httpbinx/routers/auth.py,sha256=nGZA1aQtrS2B74vM2NORHSWMXf5q25JC2J63hAO2_Us,717
|
13
15
|
httpbinx/routers/cookies.py,sha256=TB3ADXXg0kgZX5nE1QlrVk1mKXjdFAMJ7iMfd8kfMBc,2341
|
14
16
|
httpbinx/routers/dynamicdata.py,sha256=Cas2JWkQnCaKNuE0Vw84h4YKcfl8PlsvAy6kYdvw_f4,6790
|
15
17
|
httpbinx/routers/httpmethods.py,sha256=X9YPADi9D6FQnybJWyXc5BTDErgFZ5Xa4OIy7OKAifQ,1531
|
16
|
-
httpbinx/routers/images.py,sha256=
|
17
|
-
httpbinx/routers/redirects.py,sha256=aEWL1VcEaqzAz-nr7fPgKw1_iA_JCtbzS6syB0Urs4E,3023
|
18
|
-
httpbinx/routers/responseformats.py,sha256=sqRLzSFjUmN5B9urbMVR7X_AydqvuT1pvHGIXyzhedw,4996
|
19
|
-
httpbinx/routers/statuscodes.py,sha256=Iu0dcGsXLv34otIrH6WrWm_vOHt-9zAnblojM-d_qV0,1740
|
18
|
+
httpbinx/routers/images.py,sha256=d38pKQMinCbnipaBmE0gBlYar8Kog0ZOQEaaLregLZ8,2185
|
20
19
|
httpbinx/routers/inspection/__init__.py,sha256=OMPci9p6uK9L6uFKQKbIqOn-r5MndCWSqlw-bJsUE3E,166
|
21
20
|
httpbinx/routers/inspection/request.py,sha256=8b5HEuX2ED-YjMB5S0h-2xZDAmyo4ru9RX2S1tCwaqs,1224
|
22
21
|
httpbinx/routers/inspection/response.py,sha256=yJ46k1O80WO8hq4gF09KHrsQJeP7Cn0aj6AAphfyyAY,2863
|
22
|
+
httpbinx/routers/redirects.py,sha256=aEWL1VcEaqzAz-nr7fPgKw1_iA_JCtbzS6syB0Urs4E,3023
|
23
|
+
httpbinx/routers/responseformats.py,sha256=sqRLzSFjUmN5B9urbMVR7X_AydqvuT1pvHGIXyzhedw,4996
|
24
|
+
httpbinx/routers/statuscodes.py,sha256=Iu0dcGsXLv34otIrH6WrWm_vOHt-9zAnblojM-d_qV0,1740
|
25
|
+
httpbinx/schemas.py,sha256=QxBcsd4Go1azLPWF8E_uLyUVcnzI7Rwny-woDPvAzp0,4029
|
23
26
|
httpbinx/static/UTF-8-demo.txt,sha256=rtAgU6uoYvQ0w7ij9JbkKdw6c3q-RchO1bAmrVzhksw,14058
|
27
|
+
httpbinx/static/bombs/bomb-1GB.br,sha256=pRVe549TQ4bzSP231INlng3sL_cGaDY6FQdaF7XtYKY,828
|
28
|
+
httpbinx/static/bombs/bomb-1GB.gz,sha256=9k1T0WSAGsXMi3e7kH-v_U8bZHMF3sgb4jOYroJ4ymY,1019197
|
24
29
|
httpbinx/static/favicon.png,sha256=EsETjrMhmZy6X3LgRmOr_nu6dMWYGPGQ4XH3ESebrco,1291
|
25
30
|
httpbinx/static/images/httbinx_logo.png,sha256=wqrQoDwsMvFgXtXeHfmtTqFrnsTA94N_esLo-5yfF58,3893
|
26
31
|
httpbinx/static/images/httpbinx_cover.png,sha256=S8UtWBtwrfOUJTxyB1KsF9BFIh2UaRI3MEaZYemgLdU,2257
|
@@ -28,12 +33,7 @@ httpbinx/static/images/jackal.jpg,sha256=wCjXqhXoUbDu-zFjihhWSYojf68YKQUIMtO5sZ-
|
|
28
33
|
httpbinx/static/images/pig_icon.png,sha256=VBoe9Tc749xJ_FQv2aZRd7ZkrsAcjYYI-Z5uyVV32ME,8090
|
29
34
|
httpbinx/static/images/svg_logo.svg,sha256=LRFGCOzBcGDJK23iK_93dKcQjz2ilokvrRMsNSR4rrE,8982
|
30
35
|
httpbinx/static/images/wolf_1.webp,sha256=Vnz6-U668nnOpOsLwFxGVQIftO4ASspSwJZwnTuoemM,10568
|
31
|
-
httpbinx/templates/
|
32
|
-
httpbinx/templates/
|
33
|
-
httpbinx/templates/
|
34
|
-
httpbinx/
|
35
|
-
httpbinx-1.6.0.dist-info/LICENSE,sha256=t6oZPzEcm1CsBu9sB_8JYTc5rSOUhyQUee5qvAg4o-A,1060
|
36
|
-
httpbinx-1.6.0.dist-info/METADATA,sha256=ULkdGc20-rFItJKayo4H-PvntGEqZJS4NngOcEz2cfk,2310
|
37
|
-
httpbinx-1.6.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
38
|
-
httpbinx-1.6.0.dist-info/top_level.txt,sha256=zg7vMSUefYOTEUftRjOOmG3W5kfueHlHWG7zr46q1jI,9
|
39
|
-
httpbinx-1.6.0.dist-info/RECORD,,
|
36
|
+
httpbinx/templates/moby.html,sha256=o519fgNb4vga6kx6ARW3MYpV7xrRJFzmyrOZwUmrYw8,3962
|
37
|
+
httpbinx/templates/sample.xml,sha256=K12JbH36KNaAaBLkfyOhsUeXc-GfLHluHffGY3l2-V0,550
|
38
|
+
httpbinx/templates/trackingscripts.html,sha256=3E-Lg6NpBpF74H3srJuswtHfD87gNEsuVxsjm9cqIYM,625
|
39
|
+
httpbinx-1.8.0.dist-info/RECORD,,
|
httpbinx/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.6.0
|
httpbinx/templates/index.html
DELETED
@@ -1,251 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
|
4
|
-
<head>
|
5
|
-
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
6
|
-
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
7
|
-
<title>httpbin(1): HTTP Client Testing Service</title>
|
8
|
-
<style type='text/css' media='all'>
|
9
|
-
/* style: man */
|
10
|
-
|
11
|
-
body#manpage {
|
12
|
-
margin: 0;
|
13
|
-
}
|
14
|
-
|
15
|
-
.mp {
|
16
|
-
max-width: 100ex;
|
17
|
-
padding: 0 9ex 1ex 4ex;
|
18
|
-
}
|
19
|
-
|
20
|
-
.mp p,
|
21
|
-
.mp pre,
|
22
|
-
.mp ul,
|
23
|
-
.mp ol,
|
24
|
-
.mp dl {
|
25
|
-
margin: 0 0 20px 0;
|
26
|
-
}
|
27
|
-
|
28
|
-
.mp h2 {
|
29
|
-
margin: 10px 0 0 0;
|
30
|
-
}
|
31
|
-
|
32
|
-
.mp>p,
|
33
|
-
.mp>pre,
|
34
|
-
.mp>ul,
|
35
|
-
.mp>ol,
|
36
|
-
.mp>dl {
|
37
|
-
margin-left: 8ex;
|
38
|
-
}
|
39
|
-
|
40
|
-
.mp h3 {
|
41
|
-
margin: 0 0 0 4ex;
|
42
|
-
}
|
43
|
-
|
44
|
-
.mp dt {
|
45
|
-
margin: 0;
|
46
|
-
clear: left;
|
47
|
-
}
|
48
|
-
|
49
|
-
.mp dt.flush {
|
50
|
-
float: left;
|
51
|
-
width: 8ex;
|
52
|
-
}
|
53
|
-
|
54
|
-
.mp dd {
|
55
|
-
margin: 0 0 0 9ex;
|
56
|
-
}
|
57
|
-
|
58
|
-
.mp h1,
|
59
|
-
.mp h2,
|
60
|
-
.mp h3,
|
61
|
-
.mp h4 {
|
62
|
-
clear: left;
|
63
|
-
}
|
64
|
-
|
65
|
-
.mp pre {
|
66
|
-
margin-bottom: 20px;
|
67
|
-
}
|
68
|
-
|
69
|
-
.mp pre+h2,
|
70
|
-
.mp pre+h3 {
|
71
|
-
margin-top: 22px;
|
72
|
-
}
|
73
|
-
|
74
|
-
.mp h2+pre,
|
75
|
-
.mp h3+pre {
|
76
|
-
margin-top: 5px;
|
77
|
-
}
|
78
|
-
|
79
|
-
.mp img {
|
80
|
-
display: block;
|
81
|
-
margin: auto;
|
82
|
-
}
|
83
|
-
|
84
|
-
.mp h1.man-title {
|
85
|
-
display: none;
|
86
|
-
}
|
87
|
-
|
88
|
-
.mp,
|
89
|
-
.mp code,
|
90
|
-
.mp pre,
|
91
|
-
.mp tt,
|
92
|
-
.mp kbd,
|
93
|
-
.mp samp,
|
94
|
-
.mp h3,
|
95
|
-
.mp h4 {
|
96
|
-
font-family: monospace;
|
97
|
-
font-size: 14px;
|
98
|
-
line-height: 1.42857142857143;
|
99
|
-
}
|
100
|
-
|
101
|
-
.mp h2 {
|
102
|
-
font-size: 16px;
|
103
|
-
line-height: 1.25;
|
104
|
-
}
|
105
|
-
|
106
|
-
.mp h1 {
|
107
|
-
font-size: 20px;
|
108
|
-
line-height: 2;
|
109
|
-
}
|
110
|
-
|
111
|
-
.mp {
|
112
|
-
text-align: justify;
|
113
|
-
background: #fff;
|
114
|
-
}
|
115
|
-
|
116
|
-
.mp,
|
117
|
-
.mp code,
|
118
|
-
.mp pre,
|
119
|
-
.mp pre code,
|
120
|
-
.mp tt,
|
121
|
-
.mp kbd,
|
122
|
-
.mp samp {
|
123
|
-
color: #131211;
|
124
|
-
}
|
125
|
-
|
126
|
-
.mp h1,
|
127
|
-
.mp h2,
|
128
|
-
.mp h3,
|
129
|
-
.mp h4 {
|
130
|
-
color: #030201;
|
131
|
-
}
|
132
|
-
|
133
|
-
.mp u {
|
134
|
-
text-decoration: underline;
|
135
|
-
}
|
136
|
-
|
137
|
-
.mp code,
|
138
|
-
.mp strong,
|
139
|
-
.mp b {
|
140
|
-
font-weight: bold;
|
141
|
-
color: #131211;
|
142
|
-
}
|
143
|
-
|
144
|
-
.mp em,
|
145
|
-
.mp var {
|
146
|
-
font-style: italic;
|
147
|
-
color: #232221;
|
148
|
-
text-decoration: none;
|
149
|
-
}
|
150
|
-
|
151
|
-
.mp a,
|
152
|
-
.mp a:link,
|
153
|
-
.mp a:hover,
|
154
|
-
.mp a code,
|
155
|
-
.mp a pre,
|
156
|
-
.mp a tt,
|
157
|
-
.mp a kbd,
|
158
|
-
.mp a samp {
|
159
|
-
color: #0000ff;
|
160
|
-
}
|
161
|
-
|
162
|
-
.mp b.man-ref {
|
163
|
-
font-weight: normal;
|
164
|
-
color: #434241;
|
165
|
-
}
|
166
|
-
|
167
|
-
.mp pre {
|
168
|
-
padding: 0 4ex;
|
169
|
-
}
|
170
|
-
|
171
|
-
.mp pre code {
|
172
|
-
font-weight: normal;
|
173
|
-
color: #434241;
|
174
|
-
}
|
175
|
-
|
176
|
-
.mp h2+pre,
|
177
|
-
h3+pre {
|
178
|
-
padding-left: 0;
|
179
|
-
}
|
180
|
-
|
181
|
-
ol.man-decor,
|
182
|
-
ol.man-decor li {
|
183
|
-
margin: 3px 0 10px 0;
|
184
|
-
padding: 0;
|
185
|
-
float: left;
|
186
|
-
width: 33%;
|
187
|
-
list-style-type: none;
|
188
|
-
text-transform: uppercase;
|
189
|
-
color: #999;
|
190
|
-
letter-spacing: 1px;
|
191
|
-
}
|
192
|
-
|
193
|
-
ol.man-decor {
|
194
|
-
width: 100%;
|
195
|
-
}
|
196
|
-
|
197
|
-
ol.man-decor li.tl {
|
198
|
-
text-align: left;
|
199
|
-
}
|
200
|
-
|
201
|
-
ol.man-decor li.tc {
|
202
|
-
text-align: center;
|
203
|
-
letter-spacing: 4px;
|
204
|
-
}
|
205
|
-
|
206
|
-
ol.man-decor li.tr {
|
207
|
-
text-align: right;
|
208
|
-
float: right;
|
209
|
-
}
|
210
|
-
</style>
|
211
|
-
<style type='text/css' media='all'>
|
212
|
-
/* style: 80c */
|
213
|
-
|
214
|
-
.mp {
|
215
|
-
max-width: 86ex
|
216
|
-
}
|
217
|
-
|
218
|
-
ul {
|
219
|
-
list-style: None;
|
220
|
-
margin-left: 1em !important
|
221
|
-
}
|
222
|
-
|
223
|
-
.man-navigation {
|
224
|
-
left: 101ex
|
225
|
-
}
|
226
|
-
|
227
|
-
.scheme-container {
|
228
|
-
display: none !important;
|
229
|
-
}
|
230
|
-
</style>
|
231
|
-
</head>
|
232
|
-
|
233
|
-
<body id='manpage'>
|
234
|
-
<a href="https://github.com/requests/httpbin" class="github-corner" aria-label="View source on Github">
|
235
|
-
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;"
|
236
|
-
aria-hidden="true">
|
237
|
-
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
|
238
|
-
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
|
239
|
-
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
|
240
|
-
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
|
241
|
-
fill="currentColor" class="octo-body"></path>
|
242
|
-
</svg>
|
243
|
-
</a>
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
{% include 'httpbin.1.html' %} {% if tracking_enabled %} {% include 'trackingscripts.html' %} {% endif %}
|
248
|
-
|
249
|
-
</body>
|
250
|
-
|
251
|
-
</html>
|
httpbinx/utils.py
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
from functools import lru_cache
|
3
|
-
from os import path
|
4
|
-
|
5
|
-
|
6
|
-
@lru_cache(maxsize=128)
|
7
|
-
def get_templates_abspath(subdir: str = None) -> str:
|
8
|
-
"""Return templates' folder abspath
|
9
|
-
TODO use Jinja2Templates
|
10
|
-
"""
|
11
|
-
# os.path.join(os.getcwd(), 'httpbin', 'templates')
|
12
|
-
templates_abspath = path.join(path.dirname(__file__), 'templates')
|
13
|
-
if subdir is None:
|
14
|
-
return templates_abspath
|
15
|
-
return path.join(templates_abspath, subdir)
|
@@ -1,86 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: httpbinx
|
3
|
-
Version: 1.6.0
|
4
|
-
Summary: HTTP Request & Response Service, written in Python + FastAPI.
|
5
|
-
Home-page: https://github.com/imleowoo/httpbinx
|
6
|
-
Author: Leo
|
7
|
-
Author-email: imleowoo@outlook.com
|
8
|
-
Maintainer: Leo
|
9
|
-
Maintainer-email: imleowoo@outlook.com
|
10
|
-
License: MIT
|
11
|
-
Project-URL: Source, https://github.com/imleowoo/httpbinx
|
12
|
-
Classifier: Programming Language :: Python
|
13
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
20
|
-
Requires-Python: >=3.8
|
21
|
-
Description-Content-Type: text/markdown
|
22
|
-
License-File: LICENSE
|
23
|
-
Requires-Dist: fastapi
|
24
|
-
Requires-Dist: pydantic
|
25
|
-
Requires-Dist: uvicorn
|
26
|
-
Requires-Dist: starlette
|
27
|
-
Requires-Dist: jinja2
|
28
|
-
Requires-Dist: brotli
|
29
|
-
Requires-Dist: python-multipart
|
30
|
-
|
31
|
-
](https://raw.githubusercontent.com/imleowoo/httpbinx/main/httpbinx/static/images/httpbinx_cover.png)
|
32
|
-
|
33
|
-
[](https://github.com/postmanlabs/httpbin)
|
34
|
-

|
35
|
-
|
36
|
-
# httpbinx
|
37
|
-
|
38
|
-
HTTP Request & Response Service, written in Python + FastAPI.
|
39
|
-
|
40
|
-
## Reference project
|
41
|
-
|
42
|
-
A [Kenneth Reitz](http://kennethreitz.org/bitcoin) Project. See https://github.com/postmanlabs/httpbin
|
43
|
-
|
44
|
-
## Quick Start
|
45
|
-
|
46
|
-
## Installation
|
47
|
-
|
48
|
-
### PyPI
|
49
|
-
|
50
|
-
**[httpbinx](https://pypi.org/project/httpbinx/)** is available on PyPI
|
51
|
-
|
52
|
-
```shell
|
53
|
-
$ pip install httpbinx
|
54
|
-
```
|
55
|
-
|
56
|
-
### Source Code
|
57
|
-
|
58
|
-
```shell
|
59
|
-
$ git clone https://github.com/imleowoo/httpbinx.git
|
60
|
-
$ python setup.py install # or `pip install .`
|
61
|
-
```
|
62
|
-
|
63
|
-
## Run it
|
64
|
-
|
65
|
-
### Run directly
|
66
|
-
|
67
|
-
```shell
|
68
|
-
$ uvicorn httpbinx:app --host=0.0.0.0 --port=80
|
69
|
-
```
|
70
|
-
|
71
|
-
### Run with Docker
|
72
|
-
|
73
|
-
```shell
|
74
|
-
$ docker pull leowoo/httpbinx:latest
|
75
|
-
$ docker run -p 80:80 --name httpbinx leowoo/httpbinx:latest
|
76
|
-
```
|
77
|
-
|
78
|
-
### It starts running
|
79
|
-
|
80
|
-
```text
|
81
|
-
INFO: Started server process [17044]
|
82
|
-
INFO: Waiting for application startup.
|
83
|
-
INFO: Application startup complete.
|
84
|
-
INFO: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
|
85
|
-
...
|
86
|
-
```
|
@@ -1 +0,0 @@
|
|
1
|
-
httpbinx
|
File without changes
|