From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: HTTP POST requests with url.el Date: Fri, 20 Oct 2006 21:34:20 +0200 Organization: University Koblenz-Landau Campus Koblenz Message-ID: <87u01yu6gz.fsf@baldur.nicundtas.de> References: <87ejt2ewhg.fsf@baldur.nicundtas.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1161382799 13191 80.91.229.2 (20 Oct 2006 22:19:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Oct 2006 22:19:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 21 00:19:56 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gb2iU-0004v3-I0 for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Oct 2006 00:19:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gb2iT-0003x8-Sc for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Oct 2006 18:19:49 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!news.uni-kl.de!cache.uni-koblenz.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-NNTP-Posting-Host: dslb-084-063-019-005.pools.arcor-ip.net Original-X-Trace: cache.uni-koblenz.de 1161372870 25659 84.63.19.5 (20 Oct 2006 19:34:30 GMT) Original-X-Complaints-To: news@cache.uni-koblenz.de Original-NNTP-Posting-Date: Fri, 20 Oct 2006 19:34:30 +0000 (UTC) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVVVlBlsOJqkqifzOif vtFXdYWo4XLsAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABp0lE QVQ4y8WTy46kMAxFLQb24zz2wJAPoJLeE+LaA6r8/6+0HYpHa9SLns1YKlTc42sTYwC/Cfg/YPzW Mf6w1KhPh/KI5iIXQOPTzeDNAWJ69PokPoQD6BZe42Hw/qM5wG/4Q15L6RG917hUj46BUlAn70fN 5bUX8IShOFoYDBN2iM6+AarIgKDykVgKTMWAZgJCUBPUaMTCMBUHTvBihwC2pZmIkg/Ej2BZgoLR QomG2hePoS9g4YI4TDup4deIvYGKAd9FJAF1uRCSgiaCWaDucJ5EErxnVTOoBZoQReLmBCwhce4s zSUXyvEDCGeFe6gPeMcbyMPBys3NDfjjv4yEm/wFyqxweBOZFB9Egsp0O5o5nXZADzn/DrCLRMGX 2Zb5ptid60OH6kMU+dorvSfL5esmyr1Brd9v5AbYJJske3IvlVKMUtAgv/tbqThHXtKuV2bjtYwX 0L3La143m6tnfl09zHOrXG7WLfet25ZwAee61rKnUW3b5PUEjy1jzi5vi1rcHVjH1fPitsxqztsJ su3VarPlX177m6OE/cfvfP2J42uTT9NRefjdwUXiAAAAJnpUWHRDb21tZW50AAB42nMuSk0sSU1R KM8syVAIyUhVcPf0DQAAUucHI5DLZXAAAAAaelRYdEpQRUctQ29sb3JzcGFjZQAAeNozAgAAMwAz ERZ+YwAAACd6VFh0SlBFRy1TYW1wbGluZy1mYWN0b3JzAAB42jOqMNIxrDAEYQARgwLpZA8bYgAA AABJRU5ErkJggg== User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:zo1J0PcgmF77Zal4vZ5yHYGyYm4= Original-Xref: shelby.stanford.edu gnu.emacs.help:142529 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:38150 Archived-At: Stefan Monnier writes: Hi Stefan, >> (url-request-data (concat "u=" emms-lastfm-username >> "&s=" (md5 (concat >> (md5 emms-lastfm-password) >> emms-lastfm-md5-challenge)) >> "&a[0]=" artist >> "&t[0]=" title >> "&b[0]=" album >> "&m[0]=" musicbrainz-id >> "&l[0]=" track-length >> "&i[0]=" date "\r\n"))) > >> Does anyone know what I'm doing wrong, or how I can find the bug? > > Could it be that the data needs to be be url-encoded (SPC -> %20)? I stole the url-encoding function from http-get.el: --8<---------------cut here---------------start------------->8--- (defun http-url-encode (str content-type) "URL encode STR using CONTENT-TYPE as the coding system." (apply 'concat (mapcar (lambda (c) (if (or (and (>= c ?a) (<= c ?z)) (and (>= c ?A) (<= c ?Z)) (and (>= c ?0) (<= c ?9))) (string c) (format "%%%02x" c))) (encode-coding-string str content-type)))) --8<---------------cut here---------------end--------------->8--- So I tried sending this: u%3dheimdall80%26s%3d75e64782c62944cf3a0bf850a2c45d7c%26a%5b0%5d%3dLeonard%20Cohen%26t%5b0%5d%3dThe%20Future%20%28Edited%29%26b%5b0%5d%3dNatural%20Born%20Killers%26m%5b0%5d%3d%26l%5b0%5d%3d229%26i%5b0%5d%3d2006%2d10%2d20%2019%3a29%3a33 But it fails with the same error. Another idea? Bye and thanks, Tassilo -- A child of five could understand this! Fetch me a child of five!