Solved

get http_accept_language

Posted on 2001-07-27
4
341 Views
Last Modified: 2007-12-19
How to do something like request.servervariables['http_accept_language']?

Looks like it's missing!

Note : I don't want to use anything like CGIExpert, or like it. Just pure Delphi.


Thanks
0
Comment
Question by:feup
  • 2
4 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 6339482
Try Request.GetFieldByName('http...');
ziolko.
0
 
LVL 21

Accepted Solution

by:
ziolko earned 50 total points
ID: 8730057
function TWebModule1.Headers:string;
begin
  Result:='Request headers: '+'<BR>';
  Result:=Result+'APPL_MD_PATH '+Request.GetFieldByName('APPL_MD_PATH')+'<BR>';
  Result:=Result+'APPL_PHYSICAL_PATH '+Request.GetFieldByName('APPL_PHYSICAL_PATH')+'<BR>';
  Result:=Result+'AUTH_PASSWORD '+Request.GetFieldByName('AUTH_PASSWORD')+'<BR>';
  Result:=Result+'AUTH_TYPE '+Request.GetFieldByName('AUTH_TYPE')+'<BR>';
  Result:=Result+'AUTH_USER '+Request.GetFieldByName('AUTH_USER')+'<BR>';
  Result:=Result+'CERT_COOKIE '+Request.GetFieldByName('CERT_COOKIE')+'<BR>';
  Result:=Result+'CERT_FLAGS '+Request.GetFieldByName('CERT_FLAGS')+'<BR>';
  Result:=Result+'CERT_ISSUER '+Request.GetFieldByName('CERT_ISSUER')+'<BR>';
  Result:=Result+'CERT_KEYSIZE '+Request.GetFieldByName('CERT_KEYSIZE')+'<BR>';
  Result:=Result+'CERT_SECRETKEYSIZE '+Request.GetFieldByName('CERT_SECRETKEYSIZE')+'<BR>';
  Result:=Result+'CERT_SERIALNUMBER '+Request.GetFieldByName('CERT_SERIALNUMBER')+'<BR>';
  Result:=Result+'CERT_SERVER_ISSUER '+Request.GetFieldByName('CERT_SERVER_ISSUER')+'<BR>';
  Result:=Result+'CERT_SERVER_SUBJECT '+Request.GetFieldByName('CERT_SERVER_SUBJECT')+'<BR>';
  Result:=Result+'CERT_SUBJECT '+Request.GetFieldByName('CERT_SUBJECT')+'<BR>';
  Result:=Result+'CONTENT_LENGTH '+Request.GetFieldByName('CONTENT_LENGTH')+'<BR>';
  Result:=Result+'CONTENT_TYPE '+Request.GetFieldByName('CONTENT_TYPE')+'<BR>';
  Result:=Result+'HTTPS '+Request.GetFieldByName('HTTPS')+'<BR>';
  Result:=Result+'HTTPS_KEYSIZE '+Request.GetFieldByName('HTTPS_KEYSIZE')+'<BR>';
  Result:=Result+'HTTPS_SECRETKEYSIZE '+Request.GetFieldByName('HTTPS_SECRETKEYSIZE')+'<BR>';
  Result:=Result+'HTTPS_SERVER_ISSUER '+Request.GetFieldByName('HTTPS_SERVER_ISSUER')+'<BR>';
  Result:=Result+'HTTPS_SERVER_SUBJECT '+Request.GetFieldByName('HTTPS_SERVER_SUBJECT')+'<BR>';
  Result:=Result+'INSTANCE_ID '+Request.GetFieldByName('INSTANCE_ID')+'<BR>';
  Result:=Result+'INSTANCE_META_PATH '+Request.GetFieldByName('INSTANCE_META_PATH')+'<BR>';
  Result:=Result+'LOCAL_ADDR '+Request.GetFieldByName('LOCAL_ADDR')+'<BR>';
  Result:=Result+'LOGON_USER '+Request.GetFieldByName('LOGON_USER')+'<BR>';
  Result:=Result+'PATH_INFO '+Request.GetFieldByName('PATH_INFO')+'<BR>';
  Result:=Result+'PATH_TRANSLATED '+Request.GetFieldByName('PATH_TRANSLATED')+'<BR>';
  Result:=Result+'QUERY_STRING '+Request.GetFieldByName('QUERY_STRING')+'<BR>';
  Result:=Result+'REMOTE_ADDR '+Request.GetFieldByName('REMOTE_ADDR')+'<BR>';
  Result:=Result+'REMOTE_HOST '+Request.GetFieldByName('REMOTE_HOST')+'<BR>';
  Result:=Result+'REMOTE_PORT '+Request.GetFieldByName('REMOTE_PORT')+'<BR>';
  Result:=Result+'REMOTE_USER '+Request.GetFieldByName('REMOTE_USER')+'<BR>';
  Result:=Result+'REQUEST_METHOD '+Request.GetFieldByName('REQUEST_METHOD')+'<BR>';
  Result:=Result+'SCRIPT_NAME '+Request.GetFieldByName('SCRIPT_NAME')+'<BR>';
  Result:=Result+'SERVER_NAME '+Request.GetFieldByName('SERVER_NAME')+'<BR>';
  Result:=Result+'SERVER_PORT '+Request.GetFieldByName('SERVER_PORT')+'<BR>';
  Result:=Result+'SERVER_PORT_SECURE '+Request.GetFieldByName('SERVER_PORT_SECURE')+'<BR>';
  Result:=Result+'SERVER_PROTOCOL '+Request.GetFieldByName('SERVER_PROTOCOL')+'<BR>';
  Result:=Result+'SERVER_SOFTWARE '+Request.GetFieldByName('SERVER_SOFTWARE')+'<BR>';
  Result:=Result+'URL '+Request.GetFieldByName('URL')+'<BR>';
  Result:=Result+'--------------------------------------RAW_DATA-------------------------<BR>';
  Result:=Result+'ALL_RAW '+Request.GetFieldByName('ALL_RAW')+'<BR>';
  if Pos('Windows CE',Request.GetFieldByName('ALL_RAW')) > 0 then
    Result:=Result+'Windows CE based system <BR>'
  else
    Result:=Result+'Windows based system <BR>';
  if Pos('240x320',Request.GetFieldByName('ALL_RAW')) > 0 then
    Result:=Result+'Device is <B>iPAQ</B> <BR>'
  else
    Result:=Result+'Device is <B>Desktop</B> <BR>';
end;

procedure TWebModule1.WebModule1headersAction(Sender: TObject;
  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
begin
  Response.Content:=Headers;
  Handled:=True;
end;

ziolko.
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8734943
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept ziolko's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question