Hello Friends,
I need some help regarding the HTTP methods (TRACE,DELETE,PUT,HEAD).
PROBLEM EXPLAINED
------------------
I want to request from html to
servlet using these methods.As the HTML FORM method attribute supports only get or post, we cannot request use other methods for the <FORM METHOD=""> attribute.
While searching in our forum, i found the following
thread
If you want a servlet to respond to other request types, use java.net.HttpURLConnection.setRequestMethod("TRACE");
A URL created with a string starting "http://" will give you a HttpURLConnection from the getConnection method.
Can anybody please explain me
1. How to request via other http methods
2. how can i make my servlet to respond to these requests
3. What is the purpose of the HttpURLConnection
Thanks in advance
If we are going to write the
java.net.HttpURLConnection.setRequestMethod("TRACE"); in the servlet class,
then it wont work as
servlet comes into picture only after the request from page.
Can anyone please throw some examples with little explanation. I kindly request people to post with example.
SECOND QUESTION
What is the use of HttpURLConnection class. What is the purpose of that.
Explain me in detail.
Thanks in advance
FYI: I want to learn how these methods work .