🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Accept Post

HTTP Header

The HTTP Accept-Post response header advertises which media types are accepted by the server in a POST request.
For example, a server receiving a POST request with an unsupported media type could reply with 415 Unsupported Media Type and an Accept-Post header referencing one or more supported media types.

The header should appear in OPTIONS requests to a resource that supports the POST method.
An Accept-Post header in a response to any request method implicitly means that a POST is allowed on the target resource in the request.

Note:
IANA maintains a list of official content encodings.
The bzip and bzip2 encodings are non-standard but may be used in some cases, particularly for legacy support.

Header typeResponse header
Forbidden request headerYes

Syntax

The Accept-Post header specifies a media range in the same way as Accept, except that it has no notion of preference via q (quality values) arguments. This is because Accept-Post is a response header whereas Accept is a request header.

Here are some examples of the syntax:

Accept-Post: <media-type>/<subtype>
Accept-Post: <media-type>/*
Accept-Post: */*

To specify multiple media types, separate them with commas:
Accept-Post: <media-type>/<subtype>, <media-type>/<subtype>

 

Directives

Directives

A media type specifies the nature of the media being transferred. It is written as type/subtype. Here are some common patterns:

<media-type>/<subtype>

This represents a specific media type, such as text/html, indicating plain HTML text.

<media-type>/*

This indicates all subtypes under a media type. For example, image/* includes all image formats like PNG, SVG, GIF, and others.

*/*

This encompasses any media type, used when the exact type is not specified.

Example

Accept-Post: application/json, text/plain
Accept-Post: image/webp
Accept-Post: */*

Browser compatibility
is not relevant for this header.
The header is sent by the server and the specification does not define client behavior.

How to Modify Header using Requestly

Requestly is a powerful Chrome extension that allows you to modify HTTP headers, including the Accept header. This is especially useful for testing how your application responds to different media types during development or debugging. Steps to Modify the Accept Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Accept.
    • In the “Header Value” field, enter your preferred media type (e.g., text/html).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once set up, Requestly will inject the Accept: text/html header into all matching requests, allowing you to simulate different client behaviors and test content negotiation on your server.

You might need to modify the Accept header to see how your server responds to different types of data, such as JSON or HTML. This helps ensure your application works correctly with various content formats and improves debugging.