I''m not sure if its a bug in the blog example or in the framework but each time I hit edit, both get and post get called, no matter of the actual http method. anyone encounter that bug? -- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/7f5db192/attachment.html
ok, its fine now. something I was miss understanding. now, I''m not sure how the magic is done to call get and post. but I wish the same magic would be there for all REST method. get/post/put/delete On 7/26/06, Mathieu Jobin <mathieu at justbudget.com> wrote:> > I''m not sure if its a bug in the blog example or in the framework but each > time I hit edit, both get and post get called, no matter of the actual http > method. > > anyone encounter that bug? > > -- > gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static > -ldl -lcrypt -lm -o ruby > Everyone is trying their hardest to do their job but management has set it > up so that it''s impossible. > Take the control over your money, track your expenses > http://justbudget.com > > Mathieu >-- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/89037a26/attachment.html
On 7/25/06, Mathieu Jobin <mathieu at justbudget.com> wrote:> ok, its fine now. something I was miss understanding. > > now, I''m not sure how the magic is done to call get and post. but I wish the > same magic would be there for all REST method. > > get/post/put/deleteMathieu, there''s not much magic in that handling. It just takes the incoming HTTP method and calls the corresponding method in your class. In theory, all it would take to handle put or delete is to add those methods to your code. The problem is that HTML does not support those methods. That is <form method="put"></form> doesn''t work. It sucks, but that''s the way it is. Even if we beg and plead the powers-that-be at the W3C to add it, it''ll take years for the browsers to catch up. Rails gets around this problem by faking it and adding a hidden form value with the method. The things people will do...
The things people will do ....... ? its like an horror movie where the guy talk on the phone and suddenly gets his throat cut. unfortunately, its physically impossible for me to run to his house see how his doing and get myself killed in turn. back to the real life, what you said is true. I did not realize the browsers and the HTML did not support those methods. I thought the browser was stupidly sending to the server whatever and the server would reject method other than get and post. actually I can''t find it in my httpd.conf but I really thought GET and POST was specially specified as ACCEPTED. in the mean time rails way ain''t bad I guess . On 7/26/06, Thomas Lockney <tlockney at gmail.com> wrote:> > On 7/25/06, Mathieu Jobin <mathieu at justbudget.com > wrote: > > ok, its fine now. something I was miss understanding. > > > > now, I''m not sure how the magic is done to call get and post. but I wish > the > > same magic would be there for all REST method. > > > > get/post/put/delete > > Mathieu, there''s not much magic in that handling. It just takes the > incoming HTTP method and calls the corresponding method in your class. > In theory, all it would take to handle put or delete is to add those > methods to your code. The problem is that HTML does not support those > methods. That is <form method="put"></form> doesn''t work. It sucks, > but that''s the way it is. Even if we beg and plead the powers-that-be > at the W3C to add it, it''ll take years for the browsers to catch up. > Rails gets around this problem by faking it and adding a hidden form > value with the method. The things people will do... > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/2067b459/attachment.html
http://httpd.apache.org/docs/2.2/mod/core.html#limit looks like there is more than 4 On 7/26/06, Mathieu Jobin <mathieu at justbudget.com> wrote:> > The things people will do ....... ? > > its like an horror movie where the guy talk on the phone and suddenly gets > his throat cut. > unfortunately, its physically impossible for me to run to his house see > how his doing and get myself killed in turn. > > back to the real life, what you said is true. I did not realize the > browsers and the HTML did not support those methods. I thought the browser > was stupidly sending to the server whatever and the server would reject > method other than get and post. actually I can''t find it in my httpd.confbut I really thought GET and POST was specially specified as ACCEPTED. > > in the mean time rails way ain''t bad I guess . > > > On 7/26/06, Thomas Lockney <tlockney at gmail.com> wrote: > > > > On 7/25/06, Mathieu Jobin < mathieu at justbudget.com > wrote: > > > ok, its fine now. something I was miss understanding. > > > > > > now, I''m not sure how the magic is done to call get and post. but I > > wish the > > > same magic would be there for all REST method. > > > > > > get/post/put/delete > > > > Mathieu, there''s not much magic in that handling. It just takes the > > incoming HTTP method and calls the corresponding method in your class. > > In theory, all it would take to handle put or delete is to add those > > methods to your code. The problem is that HTML does not support those > > methods. That is <form method="put"></form> doesn''t work. It sucks, > > but that''s the way it is. Even if we beg and plead the powers-that-be > > at the W3C to add it, it''ll take years for the browsers to catch up. > > Rails gets around this problem by faking it and adding a hidden form > > value with the method. The things people will do... > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > -- > gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static > -ldl -lcrypt -lm -o ruby > Everyone is trying their hardest to do their job but management has set it > up so that it''s impossible. > Take the control over your money, track your expenses > http://justbudget.com > > Mathieu >-- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/ed9c23c4/attachment.html
this is really stupid,... the protection(limitation) is really in the browser server accepts anything. oldserverip:~ mathieu$ telnet somekool.net 80 Trying 64.111.120.165... Connected to somekool.net. Escape character is ''^]''. GET /test_rest.php HTTP/1.1 host: www.somekool.net HTTP/1.1 200 OK Date: Wed, 26 Jul 2006 06:07:56 GMT Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/5.1.2 Transfer-Encoding: chunked Content-Type: text/html 154 <title>GET</title> <h1>GET</h1> <form method=''put''><input type=''submit'' id=''put'' value=''put'' /></form><form method=''post''><input type=''submit'' id=''post'' value=''post'' /></form><form method=''get''><input type=''submit'' id=''get'' value=''get'' /></form><form method=''delete''><input type=''submit'' id=''delete'' value=''delete'' /></form><pre>GET</pre> 0 PUConnection closed by foreign host. oldserverip:~ mathieu$ telnet somekool.net 80 Trying 64.111.120.165... Connected to somekool.net. Escape character is ''^]''. PUT /test_rest.php HTTP/1.1 host: www.somekool.net HTTP/1.1 200 OK Date: Wed, 26 Jul 2006 06:08:15 GMT Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/5.1.2 Transfer-Encoding: chunked Content-Type: text/html 154 <title>PUT</title> <h1>PUT</h1> <form method=''put''><input type=''submit'' id=''put'' value=''put'' /></form><form method=''post''><input type=''submit'' id=''post'' value=''post'' /></form><form method=''get''><input type=''submit'' id=''get'' value=''get'' /></form><form method=''delete''><input type=''submit'' id=''delete'' value=''delete'' /></form><pre>PUT</pre> 0 Connection closed by foreign host. oldserverip:~ mathieu$ telnet somekool.net 80 Trying 64.111.120.165... Connected to somekool.net. Escape character is ''^]''. WHATEVER /test_rest.php HTTP/1.1 host: www.somekool.net HTTP/1.1 200 OK Date: Wed, 26 Jul 2006 06:08:41 GMT Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e X-Powered-By: PHP/5.1.2 Transfer-Encoding: chunked Content-Type: text/html 163 <title>WHATEVER</title> <h1>WHATEVER</h1> <form method=''put''><input type=''submit'' id=''put'' value=''put'' /></form><form method=''post''><input type=''submit'' id=''post'' value=''post'' /></form><form method=''get''><input type=''submit'' id=''get'' value=''get'' /></form><form method=''delete''><input type=''submit'' id=''delete'' value=''delete'' /></form><pre>WHATEVER</pre> 0 Connection closed by foreign host. oldserverip:~ mathieu$ On 7/26/06, Mathieu Jobin <mathieu at justbudget.com> wrote:> > http://httpd.apache.org/docs/2.2/mod/core.html#limit > > looks like there is more than 4 > > > On 7/26/06, Mathieu Jobin <mathieu at justbudget.com> wrote: > > > > The things people will do ....... ? > > > > its like an horror movie where the guy talk on the phone and suddenly > > gets his throat cut. > > unfortunately, its physically impossible for me to run to his house see > > how his doing and get myself killed in turn. > > > > back to the real life, what you said is true. I did not realize the > > browsers and the HTML did not support those methods. I thought the browser > > was stupidly sending to the server whatever and the server would reject > > method other than get and post. actually I can''t find it in my > > httpd.conf but I really thought GET and POST was specially specified as > > ACCEPTED. > > > > in the mean time rails way ain''t bad I guess . > > > > > > On 7/26/06, Thomas Lockney <tlockney at gmail.com> wrote: > > > > > > On 7/25/06, Mathieu Jobin < mathieu at justbudget.com > wrote: > > > > ok, its fine now. something I was miss understanding. > > > > > > > > now, I''m not sure how the magic is done to call get and post. but I > > > wish the > > > > same magic would be there for all REST method. > > > > > > > > get/post/put/delete > > > > > > Mathieu, there''s not much magic in that handling. It just takes the > > > incoming HTTP method and calls the corresponding method in your class. > > > In theory, all it would take to handle put or delete is to add those > > > methods to your code. The problem is that HTML does not support those > > > methods. That is <form method="put"></form> doesn''t work. It sucks, > > > but that''s the way it is. Even if we beg and plead the powers-that-be > > > at the W3C to add it, it''ll take years for the browsers to catch up. > > > Rails gets around this problem by faking it and adding a hidden form > > > value with the method. The things people will do... > > > _______________________________________________ > > > Camping-list mailing list > > > Camping-list at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > > > > > > -- > > gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static > > -ldl -lcrypt -lm -o ruby > > Everyone is trying their hardest to do their job but management has set > > it up so that it''s impossible. > > Take the control over your money, track your expenses http://justbudget.com > > > > > > Mathieu > > > > > > -- > gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static > -ldl -lcrypt -lm -o ruby > Everyone is trying their hardest to do their job but management has set it > up so that it''s impossible. > Take the control over your money, track your expenses > http://justbudget.com > > Mathieu >-- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/de764f3b/attachment-0001.html
On Jul 26, 2006, at 8:09 AM, Mathieu Jobin wrote:> this is really stupid,... the protection(limitation) is really in > the browser > server accepts anything.I think this is because of mod_php, try to WHATEVER on a file served directly from the filesystem.
According to the W3C draft on XMLHttpRequest[1], it should support PUT and DELETE. But I''m not convinced that it works on all browsers. Safari at least looks buggy[2]. -- Cheers, zimbatm [0] [0] : http://zimbatm.oree.ch [1] : http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest [2] : http://www.opendarwin.org/pipermail/webkit-unassigned/2006-February/004838.html
you are right. its mod_php..... I get a 501 on .html with WHATEVER and a 405 with PUT probably because PUT/POST/DELETE needs to be a CGI, and .html is not executable or something like that... its good though to see the list of supported METHOD. [mathieu at hikonehq /usr/home/mathieu]$ telnet somekool.net 80 Trying 64.111.120.165... Connected to somekool.net. Escape character is ''^]''. WHATEVER /saito1.html HTTP/1.1 host: www.somekool.net HTTP/1.1 501 Method Not Implemented Date: Wed, 26 Jul 2006 06:39:06 GMT Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e Allow: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, TRACE Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 10e <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>501 Method Not Implemented</TITLE> </HEAD><BODY> <H1>Method Not Implemented</H1> WHATEVER to /saito1.html not supported.<P> Invalid method in request WHATEVER /saito1.html HTTP/1.1<P> </BODY></HTML> 0 Connection closed by foreign host. [mathieu at hikonehq /usr/home/mathieu]$ telnet somekool.net 80 Trying 64.111.120.165... Connected to somekool.net. Escape character is ''^]''. PUT /saito1.html HTTP/1.1 host: www.somekool.net HTTP/1.1 405 Method Not Allowed Date: Wed, 26 Jul 2006 06:40:03 GMT Server: Apache/1.3.33 (Unix) mod_throttle/3.1.2 DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.4.2 mod_ssl/2.8.22 OpenSSL/0.9.7e Allow: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, PATCH, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, TRACE Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 e4 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>405 Method Not Allowed</TITLE> </HEAD><BODY> <H1>Method Not Allowed</H1> The requested method PUT is not allowed for the URL /saito1.html.<P> </BODY></HTML> 0 Connection closed by foreign host. [mathieu at hikonehq /usr/home/mathieu]$ On 7/26/06, Manfred Stienstra <manfred at gmail.com> wrote:> > > On Jul 26, 2006, at 8:09 AM, Mathieu Jobin wrote: > > > this is really stupid,... the protection(limitation) is really in > > the browser > > server accepts anything. > > I think this is because of mod_php, try to WHATEVER on a file served > directly from the filesystem. > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/df207762/attachment.html
On Jul 26, 2006, at 8:42 AM, Mathieu Jobin wrote:> Allow: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, PATCH, > PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK, TRACEHet methods behind the Famous Five are all DAV methods, they''re not part of the HTTP specs.
interresting XMLHttpRequest supports it. but HTML does not ;) http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#adef-method On 7/26/06, Jonas Pfenniger <zimba.tm at gmail.com> wrote:> > According to the W3C draft on XMLHttpRequest[1], it should support PUT > and DELETE. But I''m not convinced that it works on all browsers. > Safari at least looks buggy[2]. > > -- > Cheers, > zimbatm [0] > > [0] : http://zimbatm.oree.ch > [1] : http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest > [2] : > http://www.opendarwin.org/pipermail/webkit-unassigned/2006-February/004838.html > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060726/f802cc50/attachment.html