diff --git a/docs/quickstart.md b/docs/quickstart.md
index 25c1cea..a147b04 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -255,7 +255,7 @@ httpx.exceptions.HttpError: 404 Not Found
 
 Any successful response codes will simply return `None` rather than raising an exception.
 
-``` python
+```python
 >>> r.raise_for_status()
 ```
 
@@ -296,7 +296,7 @@ For large downloads you may want to use streaming responses that do not load the
 
 You can stream the binary content of the response...
 
-```
+```python
 >>> with httpx.stream("GET", "https://www.example.com") as r:
 ...     for data in r.iter_bytes():
 ...         print(data)
@@ -304,7 +304,7 @@ You can stream the binary content of the response...
 
 Or the text of the response...
 
-```
+```python
 >>> with httpx.stream("GET", "https://www.example.com") as r:
 ...     for text in r.iter_text():
 ...         print(text)
@@ -312,7 +312,7 @@ Or the text of the response...
 
 Or stream the text, on a line-by-line basis...
 
-```
+```python
 >>> with httpx.stream("GET", "https://www.example.com") as r:
 ...     for line in r.iter_lines():
 ...         print(line)
@@ -322,7 +322,7 @@ HTTPX will use universal line endings, normalising all cases to `\n`.
 
 In some cases you might want to access the raw bytes on the response without applying any HTTP content decoding. In this case any content encoding that the web server has applied such as `gzip`, `deflate`, or `brotli` will not be automatically decoded.
 
-```
+```python
 >>> with httpx.stream("GET", "https://www.example.com") as r:
 ...     for chunk in r.iter_raw():
 ...         print(chunk)
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/setup.py b/setup.py
index 4d92524..31ad5ea 100644
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,10 @@ setup(
     python_requires=">=3.6",
     version=get_version("httpx"),
     url="https://github.com/encode/httpx",
+    project_urls={
+        "Documentation": "https://www.python-httpx.org",
+        "Source": "https://github.com/encode/httpx",
+    },
     license="BSD",
     description="The next generation HTTP client.",
     long_description=get_long_description(),
@@ -74,5 +78,6 @@ setup(
         "Programming Language :: Python :: 3.6",
         "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3 :: Only",
     ],
 )

DecodingError with zlib-compressed responses
Using the following minimal WSGI app:

```python
import zlib

def app(environ, start_response):
    start_response("200 OK", [("Content-Encoding", "deflate")])
    return [zlib.compress(b"hello world")]
```

This works fine in a web browser.

Requests is quite happy:

```
>>> import requests
>>> requests.get("http://localhost:9999")
<Response [200]>
>>> requests.get("http://localhost:9999").text
'hello world'
```

httpx says:

```
>>> httpx.get('http://localhost:9999')
Traceback (most recent call last):
  File "/Users/jamie/code/httpx/httpx/decoders.py", line 52, in decode
    return self.decompressor.decompress(data)
zlib.error: Error -3 while decompressing data: invalid stored block lengths

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jamie/code/httpx/httpx/api.py", line 170, in get
    trust_env=trust_env,
  File "/Users/jamie/code/httpx/httpx/api.py", line 96, in request
    allow_redirects=allow_redirects,
  File "/Users/jamie/code/httpx/httpx/client.py", line 568, in request
    request, auth=auth, allow_redirects=allow_redirects, timeout=timeout,
  File "/Users/jamie/code/httpx/httpx/client.py", line 593, in send
    response.read()
  File "/Users/jamie/code/httpx/httpx/models.py", line 900, in read
    self._content = b"".join([part for part in self.iter_bytes()])
  File "/Users/jamie/code/httpx/httpx/models.py", line 900, in <listcomp>
    self._content = b"".join([part for part in self.iter_bytes()])
  File "/Users/jamie/code/httpx/httpx/models.py", line 912, in iter_bytes
    yield self.decoder.decode(chunk)
  File "/Users/jamie/code/httpx/httpx/decoders.py", line 54, in decode
    raise DecodingError from exc
httpx.exceptions.DecodingError
```

The reason this is an issue and not a PR is because I don't understand the code in `decoders.py` - it very explicitly says `self.decompressor = zlib.decompressobj(-zlib.MAX_WBITS)`, which according to [the Python docs](https://docs.python.org/3/library/zlib.html#zlib.compressobj) means "Uses the absolute value of wbits as the window size logarithm, while producing a raw output stream with no header or trailing checksum." I don't know enough about zlib to understand this, but it looks very deliberate so I thought I'd better ask.
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 .
parse_log_pytest
requirements.txt
pytest pytest-asyncio pytest-trio pytest-cov pytest-xdist pytest-mock
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
execnet==2.1.1
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@bdfabe1e9a910e2fc63582199eb26386b69ea551#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-mock==3.14.0
pytest-trio==0.8.0
pytest-xdist==3.6.1
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
      - execnet==2.1.1
      - 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-mock==3.14.0
      - pytest-trio==0.8.0
      - pytest-xdist==3.6.1
      - 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
setup.py docs/quickstart.md httpx/decoders.py
setup.py docs/quickstart.md httpx/decoders.py