From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: help with URL module needed Date: Sun, 28 Nov 2004 16:38:02 +0200 Message-ID: <200411281638.02083.pogonyshev@gmx.net> References: <200411261732.12616.pogonyshev@gmx.net> <20041127.010441.112625752.jet@gyve.org> <200411261858.20645.pogonyshev@gmx.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1101653376 32530 80.91.229.6 (28 Nov 2004 14:49:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 28 Nov 2004 14:49:36 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 28 15:49:31 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CYQMk-0005Nd-00 for ; Sun, 28 Nov 2004 15:49:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYQW6-0006uT-JG for ged-emacs-devel@m.gmane.org; Sun, 28 Nov 2004 09:59:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CYQVy-0006uO-CN for emacs-devel@gnu.org; Sun, 28 Nov 2004 09:59:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CYQVx-0006uC-UF for emacs-devel@gnu.org; Sun, 28 Nov 2004 09:59:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CYQVx-0006u9-RD for emacs-devel@gnu.org; Sun, 28 Nov 2004 09:59:01 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1CYQMY-00021G-4m for emacs-devel@gnu.org; Sun, 28 Nov 2004 09:49:18 -0500 Original-Received: (qmail 1619 invoked by uid 65534); 28 Nov 2004 14:49:04 -0000 Original-Received: from unknown (EHLO localhost.localdomain) (195.50.12.121) by mail.gmx.net (mp008) with SMTP; 28 Nov 2004 15:49:04 +0100 X-Authenticated: #16844820 Original-To: Masatake YAMATO , Thien-Thi Nguyen User-Agent: KMail/1.4.3 In-Reply-To: <200411261858.20645.pogonyshev@gmx.net> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30454 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30454 I wrote: > > > I'm trying to login to Wikipedia from within Emacs using the URL > > > module (to be able to edit and save articles in Emacs.) However, > > > I'm having problems with sending POST requests (to transmit login > > > information.) Here is what I get: > > > > > > [in *URL-DEBUG* buffer]: > > > > Which version of emacs do you use? > > If you use the source code in the CVS repository, could you tell me > > the date? > > CVS of November 14. > > > How can I reproduce the error? > > I made more experiments and narrowed down conditions that lead to error= =2E > You need an account in the English Wikipedia domain (en.wikipedia.org). I'll assume the lack of response is due to nobody's having an account at Wikipedia ;) So, I'll ease it. Evaluate these two functions and type `M-x wikipedia-login RET': (defun wikipedia-login () (interactive) (let ((domain "en") =09(url-request-method "POST") =09(url-request-extra-headers '(("Content-Type" . "application/x-www-form= -urlencoded"))) =09(url-request-data =09 (wikipedia-build-post-data '(("wpName" . "Testy Test") =09=09=09=09 ("wpLoginattempt" . "Login") =09=09=09=09 ("wpPassword" . "test") =09=09=09=09 ("wpRetype" . "") =09=09=09=09 ("wpEmail" . "")))) =09(url-debug=09 t)) (url-retrieve (concat "http://" domain ".wikipedia.org/w/wiki.phtml?t= itle=3DSpecial:Userlogin&action=3Dsubmit") =09=09 (lambda () (pop-to-buffer (current-buffer)))))) (defun wikipedia-build-post-data (post-data-alist) (mapconcat (lambda (association) =09 (concat (car association) "=3D" =09=09 (url-hexify-string (cdr association)))) =09 post-data-alist "&")) You should get a ``411 Length Required''. Now go back and change the (valid) password to anything else, evaluate the new function and type `M-x wikipedia-login RET' again. You should get ``200 OK''. Now, I agree that this doesn't really look like an URL module problem. But can anyone confirm this weird behaviour and explain me (or at least guess) what's going wrong? Paul