How to get the headers of the requesting client?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 57
- Joined: Mon Oct 28, 2013 1:23 pm
- Location: Dresden, Germany
How to get the headers of the requesting client?
Hi,
in PHP there is a command getallheaders(), which allows to see the request headers of the client.
I couldn't find a similar command in LC server. Is there something similar or how could I get these client information?
Cheers,
Torsten
in PHP there is a command getallheaders(), which allows to see the request headers of the client.
I couldn't find a similar command in LC server. Is there something similar or how could I get these client information?
Cheers,
Torsten
-
- VIP Livecode Opensource Backer
- Posts: 7257
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How to get the headers of the requesting client?
I'm not sure if these are what you want but look at:
libURLLastHTTPHeaders
libURLLastRRHeaders
libURLLastHTTPHeaders
libURLLastRRHeaders
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 21
- Joined: Mon Aug 26, 2013 6:49 pm
Re: How to get the headers of the requesting client?
Check out the array variable "$_SERVER" in the dictionary.
Ralf
-
- VIP Livecode Opensource Backer
- Posts: 136
- Joined: Tue Feb 23, 2010 10:53 pm
- Location: Saint Louis, Missouri USA
Re: How to get the headers of the requesting client?
Torsten:
Take a look at this posting on the forum:
https://forums.livecode.com/viewtopic.p ... 88#p217208
From that posting:
I think what you want is in the line that starts with: "HTTP_ACCEPT"
Let us know if this helps.
Bob
Take a look at this posting on the forum:
https://forums.livecode.com/viewtopic.p ... 88#p217208
From that posting:
You can try it out here: https://morrevbon.com/listVars.lcOpen the LiveCode dictionary and look for $_SERVER.
I have a file on my server (at on-rev LiveCode Hosting) that loops through the $_SERVER array and returns each line.
I think what you want is in the line that starts with: "HTTP_ACCEPT"
Let us know if this helps.
Bob
-
- Posts: 57
- Joined: Mon Oct 28, 2013 1:23 pm
- Location: Dresden, Germany
Re: How to get the headers of the requesting client?
Hi Bob and Ralf,
the solution is $_SERVER, BUT the dictionary is not complete, that's why I haven't found the solution. The server keys with HTPP_* were not mentionied in the dictionary!
Here is the code that is somehow similar from Bob's code to show all $_SERVER[*] keys.
Cheers,
Torsten
the solution is $_SERVER, BUT the dictionary is not complete, that's why I haven't found the solution. The server keys with HTPP_* were not mentionied in the dictionary!
Here is the code that is somehow similar from Bob's code to show all $_SERVER[*] keys.
Cheers,
Torsten
Code: Select all
<?lc
put "<table>" & cr
repeat for each key tKey in $_SERVER
put "<tr><td><b>" & tKey & "</b></td>" & "<td>" & $_SERVER[tkey] & "</td><tr>" & cr
end repeat
put "</table>" & cr
?>
-
- Posts: 57
- Joined: Mon Oct 28, 2013 1:23 pm
- Location: Dresden, Germany
Re: How to get the headers of the requesting client?
In order to complete the answer of my question by myself:
HTTP_ACCEPT_LANGUAGE
HTTP_ACCEPT_ENCODING
HTTP_USER_AGENT
HTTP_ACCEPT
are the header values I was looking for.
Thanks to all for the help!
Torsten
HTTP_ACCEPT_LANGUAGE
HTTP_ACCEPT_ENCODING
HTTP_USER_AGENT
HTTP_ACCEPT
are the header values I was looking for.
Thanks to all for the help!
Torsten