• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

setRequestProperty()

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ram Jeevi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Henry
 
Onion rings are vegetable donuts. Taste this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic