Back to HTTP Headers
Response

HTTP Content-Disposition Header

Indicates how the response content should be displayed. Can suggest a filename for download or indicate inline display.

Purpose

Controls whether content is displayed in the browser (inline) or downloaded as an attachment with a suggested filename.

Content-Disposition: inline Content-Disposition: attachment Content-Disposition: attachment; filename="report.pdf"

Code Examples

See how to use the Content-Disposition header in different tools and languages.

curl -I https://api.example.com/download
# Response header:
# Content-Disposition: attachment; filename="data.csv"

curl -OJ https://api.example.com/download
# Downloads with the suggested filename

Related Headers

Test Your APIs

content-disposition headerhttp content-dispositionhttp headers guide