I'm developing an application that communicates with an internal web service using HTTP.
Are there any "best practices" for custom user-agent strings so that I can put a nice one in my app? It's a Python library and the lower transport is Python's own httplib. Should the user-agent string say that or something else?
Depending on web-server and their settings these limits vary from 4KB to 64KB (total for all headers). Apache limits the maximum field length to 8k (httpd.apache.org/docs/2.2/mod/core.html#limitrequestfieldsize).
So if you're creating a new user agent for your browser, bot, app or script, it's a very good idea to keep your user agent as simple as possible - only use letters, numbers and basic symbols (brackets, hypens, slashes etc).
The process is called user-agent spoofing. Yes, when a browser or any client sends a different user-agent HTTP header from what they are and fake it that is called spoofing.
The User-Agent (UA) string is contained in the HTTP headers and is intended to identify devices requesting online content. The User-Agent tells the server what the visiting device is (among many other things) and this information can be used to determine what content to return.
For internal use you can use anything really.
Of course, internal or external its always a good idea to include contact information, either web or email address, in case something breaks or application goes out of control.
Check this big list of user agents for inspiration: http://www.user-agents.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With