我正在尝试获取发出请求的输入设备的详细信息。
我想知道,使用 httpservlet 请求对象是否可以实现这一点。
最佳答案
查看 HTTP header USER-AGENT和 headers
This line if present gives the software program used by the original client. This is for statistical purposes and the tracing of protocol violations. It should be included. The first white space delimited word must be the software product name, with an optional slash and version designator. Other products which form part of the user agent may be put as separate words.
<field> = User-Agent: <product>+
<product> = <word> [/<version>]
<version> = <word>
示例:
User-Agent: LII-Cello/1.0 libwww/2.5
获取它们
Header[] allHeaders = req.getAllHeaders();
每个 header 对象都包含名称和值。
关于java - 是否可以在http请求中获取输入设备详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18847748/