黑莓用户代理只能通过浏览器发送吗?
我想问HTTP请求头中的User-Agent属性是否只能通过浏览器发送?
当我从黑莓应用程序发送 http/https 请求时,http 标头中似乎没有包含用户代理。
非常感谢!
另外,如果无法从请求中获取用户代理,我们是否能够从 Blackberry 设备获取用户代理?
谢谢!
I would like to ask wheter the User-Agent property in the HTTP request header only sent via browser?
When I send a http/https request from a blackberry application, it seems there is no user-agent contains in the http header.
Thanks very much!
Also, if it is not possible to get the user agent from the request, are we able to get the user agent from Blackberry device?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
不,如果您在应用程序中使用 javax.microedition.io.HttpConnection,则不会自动发送 User-Agent。
相反,使用
<代码>
If you need information about the device to send along the agent string, all of it (OS version, device etc.) is accessible via BlackBerry API: look at this class: net.rim.device.api.system.DeviceInfo
No, User-Agent is not sent automatically if you use javax.microedition.io.HttpConnection from within your application.
Instead, use
If you need information about the device to send along the agent string, all of it (OS version, device etc.) is accessible via BlackBerry API: look at this class: net.rim.device.api.system.DeviceInfo
对于未签名的 j2me 应用程序,您无法设置用户代理,并且它将始终是
UNTRUSTED/1.0
http://www.j2megame.org/j2meapi/JSR_271_Mobile_Information_Device_Profile_3_0/javax/microedition/io/package-summary.html
For unsigned j2me applications you can't set the user-agent and it will always be
UNTRUSTED/1.0
http://www.j2megame.org/j2meapi/JSR_271_Mobile_Information_Device_Profile_3_0/javax/microedition/io/package-summary.html
是的,根据Java文档(javax.microedition.io
),除非您设置它,否则似乎不会自动包含用户代理。
http://www.j2megame.org/j2meapi/JSR_271_Mobile_Information_Device_Profile_3_0/javax/microedition/io/package-summary.html
Yes, according to the Java document (javax.microedition.io
), it seems that user-agent is not automatically included unless you set it.
http://www.j2megame.org/j2meapi/JSR_271_Mobile_Information_Device_Profile_3_0/javax/microedition/io/package-summary.html
将 WTK-Edit-Preference-Security-Security 域中的级别从不可信设置为最大有助于解决 http 请求中的“不可信”用户代理问题。
Turn the level from untrusted to maximum in WTK-Edit-Preference-Security-Security domain can be helpful to the "untrusted" user-agent problem in http requests.