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.