Casting to an HttpURLConnection
Normally when I need an HttpURLConnection I just create a URL object, call the openConnection() method and cast the resulting URLConnection to an HttpURLConnection. I've never had any problems with it before, but now when I try to do it, I get a classCastException. Any ideas why this is?
I tried setting some headers on the page I was trying to access but I still can't seem to get it to work. I was originally trying it with an asp page but now even an html page won't work for me.
Any help would be appreciated.
Alan