• Post Reply Bookmark Topic Watch Topic
  • New Topic

granularity of http connection

 
Jeff Gaer
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know I can do this with socket level code, but I was wondering why java.net.URL does not give the ability to set the headers on an http connection. For example If a client wants to post to server that requires Basic authentication it would be nice to be able to set the authentication header.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're looking for URLConnection.setRequestProperty().
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!