Skip to content

Commit

Permalink
added netrc support encode#177
Browse files Browse the repository at this point in the history
  • Loading branch information
can committed Jul 31, 2019
1 parent db6731a commit 2543814
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 3 deletions.
16 changes: 16 additions & 0 deletions httpx/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def request(
cert: CertTypes = None,
verify: VerifyTypes = True,
stream: bool = False,
trust_env: bool = True,
) -> Response:
with Client() as client:
return client.request(
Expand All @@ -49,6 +50,7 @@ def request(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -64,6 +66,7 @@ def get(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"GET",
Expand All @@ -77,6 +80,7 @@ def get(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -92,6 +96,7 @@ def options(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"OPTIONS",
Expand All @@ -105,6 +110,7 @@ def options(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -120,6 +126,7 @@ def head(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"HEAD",
Expand All @@ -133,6 +140,7 @@ def head(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -151,6 +159,7 @@ def post(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"POST",
Expand All @@ -167,6 +176,7 @@ def post(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -185,6 +195,7 @@ def put(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"PUT",
Expand All @@ -201,6 +212,7 @@ def put(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -219,6 +231,7 @@ def patch(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"PATCH",
Expand All @@ -235,6 +248,7 @@ def patch(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)


Expand All @@ -253,6 +267,7 @@ def delete(
cert: CertTypes = None,
verify: VerifyTypes = True,
timeout: TimeoutTypes = None,
trust_env: bool = True,
) -> Response:
return request(
"DELETE",
Expand All @@ -269,4 +284,5 @@ def delete(
cert=cert,
verify=verify,
timeout=timeout,
trust_env=trust_env,
)
Loading

0 comments on commit 2543814

Please sign in to comment.