Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Q: Setting User-Agent Field?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lawrence Page  
View profile  
 More options Jan 7 1996, 3:00 am
Newsgroups: comp.lang.java
From: p...@cs.stanford.edu (Lawrence Page)
Date: 1996/01/07
Subject: Q: Setting User-Agent Field?
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.  

Thanks, Larry Page


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joseph Millar  
View profile  
 More options Jan 9 1996, 3:00 am
Newsgroups: comp.lang.java
From: jmil...@ftp.com (Joseph Millar)
Date: 1996/01/09
Subject: Re: Q: Setting User-Agent Field?
Larry,

The User-Agent field is built in:

  .\javasrc\src\share\sun\sun\net\www\http\HttpClient.java

It looks to be a concatentation of three items:
   1) the system property "http.agent"
   2) the word "Java"
   3) the system property "java.version"

Since the agent string that gets built has only items 2 and
3, perhaps that means "http.agent" is blank (i.e. settable)?
If you could set "http.agent" prior to establishing the URL
connection, you may be able to get the desired effect.

Just a shot in the dark...

Joe Millar

In article <page-0701962007020...@qwerty.stanford.edu>, p...@cs.stanford.edu
says...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »