Page 1 of 1

HTTP delete method

Posted: Fri Jul 22, 2005 6:39 am
by Neo
I was wondering where this is used? I've also seen that the there are several other HTTP methods such as TRACE, OPTIONS etc.
Now I have apache running on my PC. Is there any way I can check these methods out using my webserver?

Re:HTTP delete method

Posted: Fri Jul 22, 2005 7:07 am
by Neo
I telnet to my pc and tried the "OPTIONS" message but this is what I got. (I typed the "OPTIONS /" after connecting).
OPTIONS /
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
webmaster@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.0.52 (Win32) Server at itlpc Port 80</address>
</body></html>
Connection closed by foreign host.
when I use The 'GET /' however I see my index page.

Re:HTTP delete method

Posted: Fri Jul 22, 2005 7:29 am
by Solar
I'm not sure how you came up with these commands in the first place, If you'd given some reference, we might be better able to follow your line of thought.

A wild guess: there are extensions to HTTP that can be used to actually make write accesses over an apache (don't worry, not enabled unless you explicitly tell it to). That would be WebDAV, for example, which is what Subversion does to tunnel code commits through apache.

Re:HTTP delete method

Posted: Fri Jul 22, 2005 8:18 am
by DennisCGc
Hi,

I looked it up in the RFC document of HTTP (ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt) which describes the DELETE command.
Quote:
9.7 DELETE

The DELETE method requests that the origin server delete the resource
identified by the Request-URI. This method MAY be overridden by human
intervention (or other means) on the origin server. The client cannot
be guaranteed that the operation has been carried out, even if the
status code returned from the origin server indicates that the action
has been completed successfully. However, the server SHOULD NOT
indicate success unless, at the time the response is given, it
intends to delete the resource or move it to an inaccessible
location.

A successful response SHOULD be 200 (OK) if the response includes an
entity describing the status, 202 (Accepted) if the action has not
yet been enacted, or 204 (No Content) if the action has been enacted
but the response does not include an entity.

If the request passes through a cache and the Request-URI identifies
one or more currently cached entities, those entries SHOULD be
treated as stale. Responses to this method are not cacheable.
My English ain't well, but as far as I understand, the server is allowed to ignore it.

HTH a bit,

DennisCGc.

PS. You can also read about the "OPTIONS" command at this document: ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt

Re:HTTP delete method

Posted: Fri Jul 22, 2005 8:53 am
by Neo
Solar wrote: I'm not sure how you came up with these commands in the first place, If you'd given some reference, we might be better able to follow your line of thought.
I don't exactly remember how I came across this info but I think I read somewhere (a long time ago) that to check if HTTP server is working fine we could telnet to that server on port 80 and issue the 'GET /' command that fetches the index page from the server.

So from there on I assumed that the underlying protocol was telnet and we coud use that to issue commands. That is why I thought that the other HTTP methods could be checked out in the same way.

BTW anyone know and good Apache server discussion forum?

Re:HTTP delete method

Posted: Fri Jul 22, 2005 9:21 am
by Neo
Basically I would like to see those other methods in action. To know how to use them.

Re:HTTP delete method

Posted: Sat Jul 23, 2005 8:36 am
by Neo
Ok.
Does anyone know how to build a HTTP header with an OPTIONS or TRACE or DELETE method?

Re:HTTP delete method

Posted: Sun Jul 24, 2005 2:05 am
by Neo
Ok I managed to figure that out with the help of ethereal 8).
Thanks anyway folks. :)

Re:HTTP delete method

Posted: Mon Jul 25, 2005 6:36 am
by Neo
Does anyone know how I can enable or disable certain HTTP methods on my web server (Apache). I see that GET POST TRACE OPTIONS are enabled.
I want to enable the DELETE and PUT methods. Any webmasters know how to do that?

Re:HTTP delete method

Posted: Mon Jul 25, 2005 6:51 am
by AGI1122
You have to modify apache's config file to do that.

I beleive this should be helpfull:
http://httpd.apache.org/docs/2.0/mod/co ... imitExcept

Re:HTTP delete method

Posted: Tue Jul 26, 2005 1:08 am
by Neo
In my user dir I created a .htaccess file and added these lines to it,
but I keep getting a internal server error on trying to view my page.

Code: Select all

<Directory>
    <LimitExcept PUT>
    </LimitExcept>
</Directory>
What is the right way to do it?

Re:HTTP delete method

Posted: Tue Jul 26, 2005 4:00 am
by AGI1122
Are you using Apache? Or Apache 2? Because that document I pointed you to is for Apache 2.

Re:HTTP delete method

Posted: Tue Jul 26, 2005 6:12 am
by Neo
Apache 2.0.52.
Is that syntax right?

Re:HTTP delete method

Posted: Tue Jul 26, 2005 7:36 am
by AGI1122
No idea, I havn't actually tested it. I just read the doc and it seems like what you wanted.