简体   繁体   中英

Is possible to get the server and language information from a web server?

I'm connection to web servers using HttpURLConnection .

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.)?

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. 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.

The two headers you'll want to look for are Server and X-Powered-By.

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. If you own the server you're wondering this about, you could of course make an API with JSP or PHP or whatever. I'm assuming that's not the case though or you'd already know :).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM