Solved

get http_accept_language

Posted on 2001-07-27
4
345 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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