Back to HTTP Headers
Request

HTTP Accept Header

Informs the server about the media types the client can process in the response. The server uses content negotiation to select one of the proposed formats.

Purpose

Tells the server what content types (MIME types) the client understands and prefers to receive.

Accept: type/subtype Accept: type/subtype, type/subtype Accept: */* (any type)

Code Examples

See how to use the Accept header in different tools and languages.

curl -H "Accept: application/json" https://api.example.com/users
curl -H "Accept: text/html" https://example.com/page
curl -H "Accept: application/json, text/plain" https://api.example.com/data

Related Headers

Test Your APIs

accept headerhttp accepthttp headers guide