HTTP delete method

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

HTTP delete method

Post 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?
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post 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.
Only Human
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:HTTP delete method

Post 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.
Every good solution is obvious once you've found it.
DennisCGc

Re:HTTP delete method

Post 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
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post 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?
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post by Neo »

Basically I would like to see those other methods in action. To know how to use them.
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post by Neo »

Ok.
Does anyone know how to build a HTTP header with an OPTIONS or TRACE or DELETE method?
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post by Neo »

Ok I managed to figure that out with the help of ethereal 8).
Thanks anyway folks. :)
Only Human
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post 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?
Only Human
AGI1122

Re:HTTP delete method

Post 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
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post 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?
Only Human
AGI1122

Re:HTTP delete method

Post by AGI1122 »

Are you using Apache? Or Apache 2? Because that document I pointed you to is for Apache 2.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:HTTP delete method

Post by Neo »

Apache 2.0.52.
Is that syntax right?
Only Human
AGI1122

Re:HTTP delete method

Post by AGI1122 »

No idea, I havn't actually tested it. I just read the doc and it seems like what you wanted.
Post Reply