Skip to content

Commit

Permalink
Expose text, html and json in highlevel api
Browse files Browse the repository at this point in the history
  • Loading branch information
lundberg committed Oct 14, 2020
1 parent a9479b8 commit 968e6c7
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 66 deletions.
112 changes: 80 additions & 32 deletions respx/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ def add(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -70,9 +73,12 @@ def add(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -83,9 +89,12 @@ def get(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -94,9 +103,12 @@ def get(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -107,9 +119,12 @@ def post(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -118,9 +133,12 @@ def post(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -131,9 +149,12 @@ def put(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -142,9 +163,12 @@ def put(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -155,9 +179,12 @@ def patch(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -166,9 +193,12 @@ def patch(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -179,9 +209,12 @@ def delete(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -190,9 +223,12 @@ def delete(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -203,9 +239,12 @@ def head(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -214,9 +253,12 @@ def head(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Expand All @@ -227,9 +269,12 @@ def options(
*,
params: Optional[QueryParamTypes] = None,
status_code: Optional[int] = None,
content: Optional[ContentDataTypes] = None,
content_type: Optional[str] = None,
headers: Optional[HeaderTypes] = None,
content_type: Optional[str] = None,
content: Optional[ContentDataTypes] = None,
text: Optional[str] = None,
html: Optional[str] = None,
json: Optional[str] = None,
pass_through: bool = False,
alias: Optional[str] = None,
) -> RequestPattern:
Expand All @@ -238,9 +283,12 @@ def options(
url=url,
params=params,
status_code=status_code,
content=content,
content_type=content_type,
headers=headers,
content_type=content_type,
content=content,
text=text,
html=html,
json=json,
pass_through=pass_through,
alias=alias,
)
Loading

0 comments on commit 968e6c7

Please sign in to comment.