wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes setRequestProperty() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setRequestProperty() " Watch "setRequestProperty() " New topic
Author

setRequestProperty()

Ram Jeevi
Greenhorn

Joined: Nov 28, 2008
Posts: 7
hi
setRequestProperty(String key, String value) is the basic definition of this method.
But in my program i am not clear with the key and value assigned to it. The program is,

URL url = new URL("http://www.google.com/");
URLConnection con = url.openConnection();

con.setRequestProperty("Proxy-Authorization","Basic " + new sun.misc.BASE64Encoder().encode( (proxyUser + ":" + proxyPassword).getBytes()));


Please some one help me to understand the above line.
thanks in advance.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18529
    
  40

con.setRequestProperty("Proxy-Authorization","Basic " + new sun.misc.BASE64Encoder().encode( (proxyUser + ":" + proxyPassword).getBytes()));


This is merely a compound statement -- perhaps it could be bettter understood if you broke it apart...



Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ram Jeevi
Greenhorn

Joined: Nov 28, 2008
Posts: 7
Thanks a lot Henry
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: setRequestProperty()
 
Similar Threads
how to invoke applet from servlet
Reading request.attributes() in my servlet dosent work, can anyone tell my why ?
Parameters GET after a connection
how to use setRequestProperty correctly?
How do you know????