This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I understand we can send HTTP GET and POST requests from a browser to a web server(via hyperlinks, and form fields etc). I wanted to know how do we trigger the other HTTP methods like GET, HEAD, PUT, TRACE, DELETE etc...
Success is never ending and Failure is neve Final
Rahul Bhattacharjee
Ranch Hand
Joined: Nov 29, 2005
Posts: 2300
posted
0
I do not think that browser uses any other method other than GET , POST.
You can have your own application making use of the other methods.
You can writing a program to make a report of all the resources available at URL (URL's will be given to you).In that case you can issue a GET command.But you purpose is just to see whether resources are available or not , not to get the resource content.So you can make use of HEAD method instead of GET.
I know a browser can only trigger GET and POST request. I wanted to know what are the other ways, if there are any, to trigger PUT, DELETE, TRACE, HEAD request. They need not be from a browser.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
A browser can send any HTTP method via the JavaScript XmlHttpRequest object.
A Java client like java.net.URLConnection or Jakarta Commons HttpClient can also do that.
My wiki server records HEAD requests when I download files. That gives the browser the information to fill in the "nnn bytes of nnn bytes" on the download progress. (Hmmm, just checking the log I don't see any. Wonder if I imagined that?) Somebody sends OPTIONS requests now and then, too. I don't know how they do it; I haven't been able to make my browser send that one.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
My wiki server records HEAD requests when I download files. That gives the browser the information to fill in the "nnn bytes of nnn bytes" on the download progress.
That sounds a bit odd. After all, the HTTP header contains the length of the response, and since the browser knows how many bytes it has read so far, there should be no need to communicate with the server.
I could imagine a browser sending HEAD requests to check if a particular resource has changed since the browser last requested (and cached) it; particularly for large files. Although that's really what conditional GET is for.