quinta-feira, 18 de dezembro de 2008

Larry no comp.lang.java.

Preciso reproduzir um post histórico do Larry, sendo Googley, anos antes de fundar a Google, no comp.lang.java. Ele pergunta como definir o User-Agent correto, em outras palavras, como dizer aos sites qual era o programa que os estava consultando realmente. Na época ele já se interessava por mecanismos de busca, e é possível que o código ao qual ele se refere virou parte do "backrub" - o precursor do Google, que seria lançado poucos anos depois.

--
I have a web robot which is a Java app. I need to be able to set the
User-Agent field in the HTTP header in order to be a good net citizen (so people know who is accessing their server). Anyone have any ideas?

Right now, Java sends a request that includes something like:

User-Agent: Java/1.0beta2

I'd rather not rewrite all the HTTP stuff myself. I tried just searching in the JDK for the Java/1.0beta2 figuring I could just change the string, but I couldn't find it. Perhaps it is stored as a unicode string?

An easy method of setting the User-Agent field should probably be added to Java, so people can properly identify their programs.

--

Fonte: comp.lang.java

0 comentário(s):