httpbinx 1.5.1__py3-none-any.whl → 1.6.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/VERSION +1 -1
- httpbinx/routers/dynamicdata.py +6 -1
- httpbinx/routers/statuscodes.py +6 -3
- httpbinx/schemas.py +7 -8
- {httpbinx-1.5.1.dist-info → httpbinx-1.6.0.dist-info}/METADATA +3 -3
- {httpbinx-1.5.1.dist-info → httpbinx-1.6.0.dist-info}/RECORD +9 -9
- {httpbinx-1.5.1.dist-info → httpbinx-1.6.0.dist-info}/WHEEL +1 -1
- {httpbinx-1.5.1.dist-info → httpbinx-1.6.0.dist-info}/LICENSE +0 -0
- {httpbinx-1.5.1.dist-info → httpbinx-1.6.0.dist-info}/top_level.txt +0 -0
httpbinx/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.6.0
|
httpbinx/routers/dynamicdata.py
CHANGED
@@ -39,7 +39,12 @@ async def decode_base64(
|
|
39
39
|
value: str = Path(
|
40
40
|
...,
|
41
41
|
title='base64-encoded string',
|
42
|
-
|
42
|
+
# examples=[AWESOME_BASE64ENCODED],
|
43
|
+
openapi_examples={
|
44
|
+
'awesome': {
|
45
|
+
'summary': 'A awesome base64 string',
|
46
|
+
'value': AWESOME_BASE64ENCODED
|
47
|
+
}}
|
43
48
|
)
|
44
49
|
):
|
45
50
|
encoded: bytes = value.encode('utf-8')
|
httpbinx/routers/statuscodes.py
CHANGED
@@ -7,12 +7,12 @@ from starlette.responses import Response
|
|
7
7
|
from httpbinx.helpers import status_code_response
|
8
8
|
from httpbinx.helpers import weighted_choice
|
9
9
|
|
10
|
-
router = APIRouter(tags=['Status
|
10
|
+
router = APIRouter(tags=['Status codes'])
|
11
11
|
|
12
12
|
|
13
13
|
@router.api_route(
|
14
14
|
'/status/{codes}',
|
15
|
-
methods=['GET'
|
15
|
+
methods=['GET'],
|
16
16
|
summary='Return status code or random status code '
|
17
17
|
'if more than one are given',
|
18
18
|
response_description='Response corresponding to different HTTP status codes.'
|
@@ -22,7 +22,10 @@ async def status_code(
|
|
22
22
|
codes: str = Path(
|
23
23
|
...,
|
24
24
|
description='a status code or status codes with weight',
|
25
|
-
|
25
|
+
# examples=['200:3,400:1'],
|
26
|
+
openapi_examples={
|
27
|
+
'sample': {'value': '200:3,400:1'}
|
28
|
+
}
|
26
29
|
),
|
27
30
|
) -> Response:
|
28
31
|
invalid_status_code_desc = 'Invalid status code'
|
httpbinx/schemas.py
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
+
import json
|
2
3
|
from enum import Enum
|
3
4
|
from functools import lru_cache
|
4
|
-
import
|
5
|
-
from typing import AnyStr
|
6
|
-
from typing import Dict
|
7
|
-
from typing import Union
|
5
|
+
from typing import AnyStr, Dict, Union
|
8
6
|
|
9
|
-
from pydantic import AnyHttpUrl
|
10
|
-
from pydantic import BaseModel
|
11
|
-
from pydantic import Field
|
7
|
+
from pydantic import AnyHttpUrl, BaseModel, Field
|
12
8
|
from starlette.requests import Request
|
13
9
|
|
14
10
|
|
@@ -103,7 +99,10 @@ class RequestAttrs:
|
|
103
99
|
@property
|
104
100
|
def client_host(self) -> str:
|
105
101
|
"""request client host."""
|
106
|
-
|
102
|
+
client = self.request.client
|
103
|
+
if client is None:
|
104
|
+
return ''
|
105
|
+
return client.host
|
107
106
|
|
108
107
|
@property
|
109
108
|
async def data(self):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: httpbinx
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.6.0
|
4
4
|
Summary: HTTP Request & Response Service, written in Python + FastAPI.
|
5
5
|
Home-page: https://github.com/imleowoo/httpbinx
|
6
6
|
Author: Leo
|
@@ -12,12 +12,12 @@ Project-URL: Source, https://github.com/imleowoo/httpbinx
|
|
12
12
|
Classifier: Programming Language :: Python
|
13
13
|
Classifier: Programming Language :: Python :: 3 :: Only
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
15
|
-
Classifier: Programming Language :: Python :: 3.7
|
16
15
|
Classifier: Programming Language :: Python :: 3.8
|
17
16
|
Classifier: Programming Language :: Python :: 3.9
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
20
|
-
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
20
|
+
Requires-Python: >=3.8
|
21
21
|
Description-Content-Type: text/markdown
|
22
22
|
License-File: LICENSE
|
23
23
|
Requires-Dist: fastapi
|
@@ -1,22 +1,22 @@
|
|
1
|
-
httpbinx/VERSION,sha256=
|
1
|
+
httpbinx/VERSION,sha256=yx2aMLxKuKOX85t9eGu4KsoLgWB37vw118giAX119qU,6
|
2
2
|
httpbinx/__init__.py,sha256=hPPEFgOAqXD22JamTP9uGK42qngDmwmM35RVg2varDA,289
|
3
3
|
httpbinx/constants.py,sha256=aJay1yI313fLxfFXgBPLE6p_UABlHq1KGEcdO7Nf2FQ,906
|
4
4
|
httpbinx/helpers.py,sha256=-fJyFbToQ0QwRY5UZ3Bkx7Ui_nj_bk8Wd4qKRtYGIsg,3787
|
5
5
|
httpbinx/main.py,sha256=idQXiobak79bY1Stm2G2aAAQO6LmrAB5dZbflJ8u5ew,837
|
6
6
|
httpbinx/meta.py,sha256=gqWHplgb0SiUFVmZ8-gbOrZA468R-y9uDCQjqeQSHN8,1185
|
7
|
-
httpbinx/schemas.py,sha256=
|
7
|
+
httpbinx/schemas.py,sha256=QxBcsd4Go1azLPWF8E_uLyUVcnzI7Rwny-woDPvAzp0,4029
|
8
8
|
httpbinx/utils.py,sha256=kMVB5ORarUJj6MdySbb8utCbgyM2WbitSmiDYBAFnSs,464
|
9
9
|
httpbinx/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
httpbinx/routers/__init__.py,sha256=xwbZGA3-sV07HCPAly8o5uUJGbdKH3pBHUakXEjvRK4,1409
|
11
11
|
httpbinx/routers/anything.py,sha256=KtNMHx4aEGQS6fc21YdHszorm1_gPIfpYuCkImgQFCA,564
|
12
12
|
httpbinx/routers/auth.py,sha256=nGZA1aQtrS2B74vM2NORHSWMXf5q25JC2J63hAO2_Us,717
|
13
13
|
httpbinx/routers/cookies.py,sha256=TB3ADXXg0kgZX5nE1QlrVk1mKXjdFAMJ7iMfd8kfMBc,2341
|
14
|
-
httpbinx/routers/dynamicdata.py,sha256=
|
14
|
+
httpbinx/routers/dynamicdata.py,sha256=Cas2JWkQnCaKNuE0Vw84h4YKcfl8PlsvAy6kYdvw_f4,6790
|
15
15
|
httpbinx/routers/httpmethods.py,sha256=X9YPADi9D6FQnybJWyXc5BTDErgFZ5Xa4OIy7OKAifQ,1531
|
16
16
|
httpbinx/routers/images.py,sha256=JBZ08Ez2gmXiGfA-jNXN3SaQzvQMmFkRrX9E0f_k3fk,2261
|
17
17
|
httpbinx/routers/redirects.py,sha256=aEWL1VcEaqzAz-nr7fPgKw1_iA_JCtbzS6syB0Urs4E,3023
|
18
18
|
httpbinx/routers/responseformats.py,sha256=sqRLzSFjUmN5B9urbMVR7X_AydqvuT1pvHGIXyzhedw,4996
|
19
|
-
httpbinx/routers/statuscodes.py,sha256=
|
19
|
+
httpbinx/routers/statuscodes.py,sha256=Iu0dcGsXLv34otIrH6WrWm_vOHt-9zAnblojM-d_qV0,1740
|
20
20
|
httpbinx/routers/inspection/__init__.py,sha256=OMPci9p6uK9L6uFKQKbIqOn-r5MndCWSqlw-bJsUE3E,166
|
21
21
|
httpbinx/routers/inspection/request.py,sha256=8b5HEuX2ED-YjMB5S0h-2xZDAmyo4ru9RX2S1tCwaqs,1224
|
22
22
|
httpbinx/routers/inspection/response.py,sha256=yJ46k1O80WO8hq4gF09KHrsQJeP7Cn0aj6AAphfyyAY,2863
|
@@ -32,8 +32,8 @@ httpbinx/templates/index.html,sha256=9--gnqsRkQjSqiZr-Ljn2gr_b3Ddr8Zx91lFk7o91Vw
|
|
32
32
|
httpbinx/templates/moby.html,sha256=4lCnl11TgB7Yw1JxeAoVodo2qKU4MyfLcG3qJSs0DUg,3742
|
33
33
|
httpbinx/templates/sample.xml,sha256=UcHibo5ClF0e3nhCbgLlQmUw33Rwnd5Rr6IYIqNQumg,522
|
34
34
|
httpbinx/templates/trackingscripts.html,sha256=M5P33NOYlYaoOEDPzaJqKWPJCPxSx2zZsYWR9DT_D5E,583
|
35
|
-
httpbinx-1.
|
36
|
-
httpbinx-1.
|
37
|
-
httpbinx-1.
|
38
|
-
httpbinx-1.
|
39
|
-
httpbinx-1.
|
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,,
|
File without changes
|
File without changes
|