diff --git a/README.md b/README.md
index cf6b9b3..27fd542 100644
--- a/README.md
+++ b/README.md
@@ -39,6 +39,18 @@ Let's get started...
 '<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'
 ```
 
+Or, using the async API...
+
+_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._
+
+```python
+>>> import httpx
+>>> async with httpx.AsyncClient() as client:
+>>>     r = await client.get('https://www.example.org/')
+>>> r
+<Response [200 OK]>
+```
+
 ## Features
 
 HTTPX builds on the well-established usability of `requests`, and gives you:
diff --git a/docs/index.md b/docs/index.md
index e3d6e2a..476f62a 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -51,6 +51,18 @@ Let's get started...
 '<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'
 ```
 
+Or, using the async API...
+
+_Use [IPython](https://ipython.readthedocs.io/en/stable/) or Python 3.8+ with `python -m asyncio` to try this code interactively._
+
+```python
+>>> import httpx
+>>> async with httpx.AsyncClient() as client:
+>>>     r = await client.get('https://www.example.org/')
+>>> r
+<Response [200 OK]>
+```
+
 ## Features
 
 HTTPX is a high performance asynchronous HTTP client, that builds on the
diff --git a/httpx/decoders.py b/httpx/decoders.py
index 75d980d..454ec4a 100644
--- a/httpx/decoders.py
+++ b/httpx/decoders.py
@@ -45,12 +45,18 @@ class DeflateDecoder(Decoder):
     """
 
     def __init__(self) -> None:
-        self.decompressor = zlib.decompressobj(-zlib.MAX_WBITS)
+        self.first_attempt = True
+        self.decompressor = zlib.decompressobj()
 
     def decode(self, data: bytes) -> bytes:
+        was_first_attempt = self.first_attempt
+        self.first_attempt = False
         try:
             return self.decompressor.decompress(data)
         except zlib.error as exc:
+            if was_first_attempt:
+                self.decompressor = zlib.decompressobj(-zlib.MAX_WBITS)
+                return self.decode(data)
             raise DecodingError from exc
 
     def flush(self) -> bytes:
diff --git a/httpx/dispatch/urllib3.py b/httpx/dispatch/urllib3.py
index 1782834..2728170 100644
--- a/httpx/dispatch/urllib3.py
+++ b/httpx/dispatch/urllib3.py
@@ -77,7 +77,7 @@ class URLLib3Dispatcher(SyncDispatcher):
             )
         else:
             return urllib3.ProxyManager(
-                proxy_url=proxy.url,
+                proxy_url=str(proxy.url),
                 proxy_headers=dict(proxy.headers),
                 ssl_context=ssl_context,
                 num_pools=num_pools,

urllib3.ProxyManager() instantiation is broken.
python 3.7.5
httpx 0.11.0
urllib3 1.25.7

```
$ ipython3 -c 'import httpx; r = httpx.get("https://www.google.com")'
parse_url http://127.0.0.1:1234 <class 'httpx.models.URL'>
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-d6fe3101235f> in <module>
----> 1 import httpx; r = httpx.get("https://www.google.com")

/usr/local/lib/python3.7/site-packages/httpx/api.py in get(url, params, headers, cookies, auth, allow_redirects, cert, verify, timeout, trust_env)
    168         verify=verify,
    169         timeout=timeout,
--> 170         trust_env=trust_env,
    171     )
    172

/usr/local/lib/python3.7/site-packages/httpx/api.py in request(method, url, params, data, files, json, headers, cookies, auth, timeout, allow_redirects, verify, cert, trust_env)
     82     """
     83     with Client(
---> 84         cert=cert, verify=verify, timeout=timeout, trust_env=trust_env,
     85     ) as client:
     86         return client.request(

/usr/local/lib/python3.7/site-packages/httpx/client.py in __init__(self, auth, params, headers, cookies, verify, cert, proxies, timeout, pool_limits, max_redirects, base_url, dispatch, app, trust_env)
    477                 trust_env=trust_env,
    478             )
--> 479             for key, proxy in proxy_map.items()
    480         }
    481

/usr/local/lib/python3.7/site-packages/httpx/client.py in <dictcomp>(.0)
    477                 trust_env=trust_env,
    478             )
--> 479             for key, proxy in proxy_map.items()
    480         }
    481

/usr/local/lib/python3.7/site-packages/httpx/client.py in init_proxy_dispatch(self, proxy, verify, cert, pool_limits, trust_env)
    512             cert=cert,
    513             pool_limits=pool_limits,
--> 514             trust_env=trust_env,
    515         )
    516

/usr/local/lib/python3.7/site-packages/httpx/dispatch/urllib3.py in __init__(self, proxy, verify, cert, trust_env, pool_limits)
     58             num_pools=num_pools,
     59             maxsize=maxsize,
---> 60             block=block,
     61         )
     62

/usr/local/lib/python3.7/site-packages/httpx/dispatch/urllib3.py in init_pool_manager(self, proxy, ssl_context, num_pools, maxsize, block)
     83                 num_pools=num_pools,
     84                 maxsize=maxsize,
---> 85                 block=block,
     86             )
     87

/usr/local/lib/python3.7/site-packages/urllib3/poolmanager.py in __init__(self, proxy_url, num_pools, headers, proxy_headers, **connection_pool_kw)
    412                 proxy_url.port,
    413             )
--> 414         proxy = parse_url(proxy_url)
    415         if not proxy.port:
    416             port = port_by_scheme.get(proxy.scheme, 80)

/usr/local/lib/python3.7/site-packages/urllib3/util/url.py in parse_url(url)
    361     print('parse_url', url, type(url))
    362     source_url = url
--> 363     if not SCHEME_RE.search(url):
    364         url = "//" + url
    365

TypeError: expected string or bytes-like object
```
diff --git a/tests/test_decoders.py b/tests/test_decoders.py
index f320d94..d9e82f7 100644
--- a/tests/test_decoders.py
+++ b/tests/test_decoders.py
@@ -18,6 +18,11 @@ REQUEST = httpx.Request("GET", "https://example.org")
 
 
 def test_deflate():
+    """
+    Deflate encoding may use either 'zlib' or 'deflate' in the wild.
+
+    https://stackoverflow.com/questions/1838699/how-can-i-decompress-a-gzip-stream-with-zlib#answer-22311297
+    """
     body = b"test 123"
     compressor = zlib.compressobj(9, zlib.DEFLATED, -zlib.MAX_WBITS)
     compressed_body = compressor.compress(body) + compressor.flush()
@@ -29,6 +34,22 @@ def test_deflate():
     assert response.content == body
 
 
+def test_zlib():
+    """
+    Deflate encoding may use either 'zlib' or 'deflate' in the wild.
+
+    https://stackoverflow.com/questions/1838699/how-can-i-decompress-a-gzip-stream-with-zlib#answer-22311297
+    """
+    body = b"test 123"
+    compressed_body = zlib.compress(body)
+
+    headers = [(b"Content-Encoding", b"deflate")]
+    response = httpx.Response(
+        200, headers=headers, content=compressed_body, request=REQUEST
+    )
+    assert response.content == body
+
+
 def test_gzip():
     body = b"test 123"
     compressor = zlib.compressobj(9, zlib.DEFLATED, zlib.MAX_WBITS | 16)

pip install -e .[dev]
parse_log_pytest
requirements.txt
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aspy.refactor-imports==3.0.2
attrs==25.3.0
autoflake==2.3.1
babel==2.17.0
backrefs==5.8
black==25.1.0
brotlipy==0.7.0
certifi==2025.1.31
cffi==1.17.1
chardet==3.0.4
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
coverage==7.8.0
cryptography==44.0.2
exceptiongroup==1.2.2
flake8==7.2.0
flake8-bugbear==24.12.12
flake8-pie==0.16.0
ghp-import==2.1.0
h11==0.9.0
h2==3.2.0
hpack==3.0.0
hstspreload==2025.1.1
-e git+https://github.com/encode/httpx.git@956129fbf71495c97844dc7adf4b595a9da4cd18#egg=httpx
hyperframe==5.2.0
idna==2.10
importlib_metadata==8.6.1
iniconfig==2.1.0
isort==6.0.1
Jinja2==3.1.6
Markdown==3.7
MarkupSafe==3.0.2
mccabe==0.7.0
mergedeep==1.3.4
mkautodoc==0.2.0
mkdocs==1.6.1
mkdocs-get-deps==0.2.0
mkdocs-material==9.6.10
mkdocs-material-extensions==1.3.1
mypy==1.15.0
mypy-extensions==1.0.0
outcome==1.3.0.post0
packaging==24.2
paginate==0.5.7
pathspec==0.12.1
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pycparser==2.22
pyflakes==3.3.1
Pygments==2.19.1
pymdown-extensions==10.14.3
pytest==8.3.5
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-trio==0.8.0
python-dateutil==2.9.0.post0
PyYAML==6.0.2
pyyaml_env_tag==0.1
requests==2.32.3
rfc3986==1.5.0
seed-isort-config==2.2.0
six==1.17.0
sniffio==1.3.1
sortedcontainers==2.4.0
tomli==2.2.1
trio==0.29.0
trustme==1.2.1
typing_extensions==4.13.0
urllib3==1.26.20
uvicorn==0.34.0
watchdog==6.0.0
zipp==3.21.0

name: httpx
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aspy-refactor-imports==3.0.2
      - attrs==25.3.0
      - autoflake==2.3.1
      - babel==2.17.0
      - backrefs==5.8
      - black==25.1.0
      - brotlipy==0.7.0
      - certifi==2025.1.31
      - cffi==1.17.1
      - chardet==3.0.4
      - charset-normalizer==3.4.1
      - click==8.1.8
      - colorama==0.4.6
      - coverage==7.8.0
      - cryptography==44.0.2
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - flake8-bugbear==24.12.12
      - flake8-pie==0.16.0
      - ghp-import==2.1.0
      - h11==0.9.0
      - h2==3.2.0
      - hpack==3.0.0
      - hstspreload==2025.1.1
      - hyperframe==5.2.0
      - idna==2.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - isort==6.0.1
      - jinja2==3.1.6
      - markdown==3.7
      - markupsafe==3.0.2
      - mccabe==0.7.0
      - mergedeep==1.3.4
      - mkautodoc==0.2.0
      - mkdocs==1.6.1
      - mkdocs-get-deps==0.2.0
      - mkdocs-material==9.6.10
      - mkdocs-material-extensions==1.3.1
      - mypy==1.15.0
      - mypy-extensions==1.0.0
      - outcome==1.3.0.post0
      - packaging==24.2
      - paginate==0.5.7
      - pathspec==0.12.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pycparser==2.22
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pymdown-extensions==10.14.3
      - pytest==8.3.5
      - pytest-asyncio==0.26.0
      - pytest-cov==6.0.0
      - pytest-trio==0.8.0
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.2
      - pyyaml-env-tag==0.1
      - requests==2.32.3
      - rfc3986==1.5.0
      - seed-isort-config==2.2.0
      - six==1.17.0
      - sniffio==1.3.1
      - sortedcontainers==2.4.0
      - tomli==2.2.1
      - trio==0.29.0
      - trustme==1.2.1
      - typing-extensions==4.13.0
      - urllib3==1.26.20
      - uvicorn==0.34.0
      - watchdog==6.0.0
      - zipp==3.21.0
prefix: /opt/conda/envs/httpx

tests/test_decoders.py::test_zlib
tests/test_decoders.py::test_deflate tests/test_decoders.py::test_gzip tests/test_decoders.py::test_brotli tests/test_decoders.py::test_multi tests/test_decoders.py::test_multi_with_identity tests/test_decoders.py::test_streaming tests/test_decoders.py::test_empty_content[deflate] tests/test_decoders.py::test_empty_content[gzip] tests/test_decoders.py::test_empty_content[br] tests/test_decoders.py::test_empty_content[identity] tests/test_decoders.py::test_decoders_empty_cases[BrotliDecoder] tests/test_decoders.py::test_decoders_empty_cases[DeflateDecoder] tests/test_decoders.py::test_decoders_empty_cases[GZipDecoder] tests/test_decoders.py::test_decoders_empty_cases[IdentityDecoder] tests/test_decoders.py::test_decoding_errors[deflate] tests/test_decoders.py::test_decoding_errors[gzip] tests/test_decoders.py::test_decoding_errors[br] tests/test_decoders.py::test_text_decoder[data0-ascii] tests/test_decoders.py::test_text_decoder[data1-utf-8] tests/test_decoders.py::test_text_decoder[data2-shift-jis] tests/test_decoders.py::test_text_decoder[data3-shift-jis] tests/test_decoders.py::test_text_decoder[data4-MacCyrillic] tests/test_decoders.py::test_text_decoder[data5-euc-jp] tests/test_decoders.py::test_text_decoder_known_encoding tests/test_decoders.py::test_text_decoder_empty_cases tests/test_decoders.py::test_line_decoder_nl tests/test_decoders.py::test_line_decoder_cr tests/test_decoders.py::test_line_decoder_crnl tests/test_decoders.py::test_invalid_content_encoding_header
httpx/decoders.py httpx/dispatch/urllib3.py docs/index.md README.md
httpx/decoders.py httpx/dispatch/urllib3.py docs/index.md README.md