Internet Direct (Indy)
Home
PreviousUpNext
TIdRequestHeaderInfo.Accept Property

Specifies the media types accepted in a HTTP response.

Pascal
property Accept: String;

Accept is a String property that specifies the media types that are acceptable in a resulting HTTP response, and can be used to limit the request to a small set of desired types. If no Accept header field is present, then it is assumed that the client accepts all media types. 

Accept is composed of the media type, subtype, and optional parameters. The asterisk "*" character is used to group media types into ranges, with "*/*" indicating all media types and "type/*" indicating all subtypes of that type. 

Each media type and subtype may include one or more parameters, beginning with the "q" parameter that indicates the relative quality factor. Quality factors allow the user agent to determine the relative degree of preference for that media type and subtype, using the qvalue scale from 0 to 1. The default value is q=1. 

Accept is updated in the ProcessHeaders method. Accept is used in SetHeaders to read the header values for the request. 

The default value for Accept is set to 'text/html, */*' when the Clear method is called.

  ARequestHeaderInfo.Accept := 'audio/*; q=0.2, audio/basic';
  ARequestHeaderInfo.Accept := 'text/plain; q=0.5, text/html';
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.