I am trying to do a little experiment with HTTP Headers. I would like to add a custom HTTP header in a JSP page( say post.jsp) and then use POST method to pass these headers into another JSP page ( say test.jsp). Does it sound like a lofty dream or can it really be done? Any suggestion would be highly appriciable.
Thank you in Advance
Author and all-around good cowpoke
posted 12 years ago
Look at the JavaDocs for URLConnection and HttpURLConnection in the java.net package. There you will find methods for examining and setting request headers. You must use the setRequestMethod("POST") in HttpURLConnection in order to do a POST as the default is GET. Bill