http AcceptTypes property
Return to Introduction  Previous page  Next page
Applies to
auHTTP component.  

property AcceptTypes: String// default is "*/*"  


The AcceptTypes property specifies the array of media types (also known as Multipurpose Internet Mail Extension (MIME) type) which you would like to receive from the Web using the auHTTP component (HTTP client). These strings indicates content types accepted by the client. If AcceptTypes is empty, no types are accepted by the client.  
iiinfo For example, if you would like to get HTML files only, set AcceptTypes property to "text/html". To receive flat-text files only, set AccessTypes to "text/plain".  
Servers interpret a lack of accept types to indicate that the client accepts only documents of type "text/*" (that is, only text documents, and not pictures or other binary files.  
To specify multiple MIME types, sepearate them by comma sign "," (ie: "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/, application/msword, */*").  
tip Some servers always checking the media types accepted by client to determinate the data format prefered by client. For example, lately some servers can returns human readable data both in HTML and WML formats. HTML used for output to standard Web-browsers and WML for output to celluar phones, handheld computers and other WAP devices. To determinate the client type, server uses the HTTP_ACCEPT environment of client:  
if ($ENV{'HTTP_ACCEPT'} =~ /wml/) {  
  print "Location:\n\n";  
}else {  
  print "Location:\n\n";  
When server founds "WML" word between the accepted types, it will redirect the client to certain WAP page. As you can see, sometimes the HTTP output depend on accepted media types.  
For more details on Accept header please see the reference at  

iiwarning Some servers does not check accepting types at all and can return files with ANY media type.  

See also
AddHeaders, Agent, URL and Referer properties.