[英]Is possible to get the server and language information from a web server?
I'm connection to web servers using HttpURLConnection
. 我正在使用
HttpURLConnection
连接到Web服务器。
Is there a way to ask to the server to send the language that the page is built (PHP, Java, Python, Ruby, etc) and the web server that is running (Apache, ISS, etc.)? 有没有办法要求服务器发送页面构建语言(PHP,Java,Python,Ruby等)和正在运行的Web服务器(Apache,ISS等)?
As web servers just deliver whatever the end content is (html/javascript/a mp3 -- whatever), they are only obligated to tell you what the content they are giving you is, not how they created it. 由于网络服务器只提供最终内容(html / javascript / a mp3等等),因此它们仅有义务告诉您它们所提供的内容是什么,而不是它们是如何创建的。 Often you will find a Server header that tells you the Apache/PHP version, but most people see that as as security vulnerability and a lot of people will disable it.
通常,您会发现一个服务器标头,告诉您Apache / PHP的版本,但是大多数人将其视为安全漏洞,很多人会禁用它。
The two headers you'll want to look for are Server and X-Powered-By. 您要查找的两个标头是Server和X-Powered-By。
http://en.wikipedia.org/wiki/List_of_HTTP_header_fields http://en.wikipedia.org/wiki/List_of_HTTP_header_fields
As far as I know, no servers have any kind of built in API for asking what the server is. 据我所知,没有服务器具有任何内置的API来询问服务器是什么。 If you own the server you're wondering this about, you could of course make an API with JSP or PHP or whatever.
如果您想知道服务器的所有权,那么您当然可以使用JSP或PHP或其他任何方法创建API。 I'm assuming that's not the case though or you'd already know :).
我假设情况并非如此,否则您已经知道:)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.