By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,727 Members | 1,391 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,727 IT Pros & Developers. It's quick & easy.

XMLHTTPRequest with PUT, DELETE, etc.

P: n/a
Hi,

is it possible to use the XMLHTTPRequest-Object with the Methods PUT
and DELETE in JavaScript? Maybe there is a tutorial or a short e.g.

thx for answer
Rufnex

Dec 2 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a


Rufnex wrote:
is it possible to use the XMLHTTPRequest-Object with the Methods PUT
and DELETE in JavaScript? Maybe there is a tutorial or a short e.g.


It might depend on the implementation or version of that object you are
using but in theory more than the regularly used POST and GET requests
are possible, just use the HTTP method as the first argument to the open
method.
For MSXML (which you use with client-side script in IE for instance) it
is documented
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/52aaf5ff-e302-4490-821a-cb3a085fe5ee.asp>
that the method parameter of the open method allows
"The HTTP method used to open the connection, such as GET, POST, PUT,
or PROPFIND"
although I don't read that as a complete list, HEAD for instance is
certainly possible too in my experience.

Mozilla's XMLHttpRequest should also have a broad support for the
various HTTP request methods.

I think other browsers like Safari first focussed on implementing the
mainly used methods GET and POST but probably have improved by now but
of course on the web you might then be prepared to have visitors with
older versions.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 2 '05 #2

P: n/a
thx for your answer . .i tried to use this methods but i got always an
error 405 (not allowed). does anyone used PUT oder DELETE sucessfull?

Dec 2 '05 #3

P: n/a

Rufnex wrote:
i tried to use this methods but i got always an
error 405 (not allowed). does anyone used PUT oder DELETE sucessfull?


If the server gives you a HTTP response status code of 405 then the
problem is very likely not with the client-side script but simply that
the server does not allow those requests you have made on the URLs you
have tried. A public HTTP server on the internet will rather not allow
PUT requests by anyone for any URL, that way anyone could change stuff
on the server.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Dec 2 '05 #4

P: n/a
VK

Rufnex wrote:
is it possible to use the XMLHTTPRequest-Object with the Methods PUT
and DELETE in JavaScript? Maybe there is a tutorial or a short e.g.


AFAIK:

The only browsers ever implemented PUT method are:

1. NCSA Mosaic
2. W3C Amaya

Besides these two there was (not a browser but still Web related)
Netscape Composer from Netscape 4.x package

Thus you can set your server to accept any existing and not-existing
requests (PUT, FOOBAR etc.) , but browser has no means to generate such
request or to accept such response.

Dec 2 '05 #5

P: n/a
On 2005-12-02, Rufnex <in**@jg-webdesign.de> wrote:
thx for your answer . .i tried to use this methods but i got always an
error 405 (not allowed). does anyone used PUT oder DELETE sucessfull?


Those error messages come from the http server, it may need reconfiguring.
check its access and error logs.

Bye.
Jasen
Dec 4 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.