Solved

get http_accept_language

Posted on 2001-07-27
4
337 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now