help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

http post behind proxy


From: Joe Corneli
Subject: http post behind proxy
Date: Fri, 18 May 2012 17:54:19 +0100

I'm getting stuck with this.  Maybe I'm setting up the URL variables
wrong but the error is coming from url-http-parse-headers in response
to the returned value.  It looks like what I'm really getting is a 404
not found.  Any ideas?

(let ((url-debug t)
      (url-using-proxy "http://my-proxy:80";)
      (url-request-method "POST")
      (url-request-extra-headers
       `(("Content-Type" . "application/xml")
         ("Authorization" . ,(concat "Basic "
                                     (base64-encode-string
                                      (concat "username" ":" "password"))))))
      (url-request-data "status='Hi From Emacs'")
      (to-send (url-generic-parse-url
"http://identi.ca/api/statuses/update.xml";)))
  (url-proxy to-send (lambda (status) (switch-to-buffer (current-buffer)))))

Backtrace:

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  setcar(nil (:error (error http 404)))
  (setf (car url-callback-arguments) (nconc (list :error ...) (car
url-callback-arguments)))
  (progn (setf (car url-callback-arguments) (nconc ... ...)))
  (if success (progn (setf ... ...)))
  (when success (setf (car url-callback-arguments) (nconc ... ...)))
  (cond ((eql class ...) (url-mark-buffer-as-dead buffer) (error "HTTP
responses in class 1xx not supported (%d)" url-http-response-status))
((eql class ...) (case url-http-response-status ... ...)) ((eql class
...) (let ... ... ...)) ((eql class ...) (case
url-http-response-status ... ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ...) (when success ...)) ((eql class ...) (setq
success t) (case url-http-response-status ... ... ... ... ... ...)
(when success ...)) (t (error "Unknown class of HTTP response code: %d
(%d)" class url-http-response-status)))
  (case class (1 (url-mark-buffer-as-dead buffer) (error "HTTP
responses in class 1xx not supported (%d)" url-http-response-status))
(2 (case url-http-response-status ... ...)) (3 (let ... ... ...)) (4
(case url-http-response-status ... ... ... ... ... ... ... ... ... ...
... ... ... ... ... ... ...) (when success ...)) (5 (setq success t)
(case url-http-response-status ... ... ... ... ... ...) (when success
...)) (otherwise (error "Unknown class of HTTP response code: %d (%d)"
class url-http-response-status)))
  (let ((buffer ...) (class nil) (success nil)
(file-name-handler-alist nil)) (setq class (/ url-http-response-status
100)) (url-http-debug "Parsed HTTP headers: class=%d status=%d" class
url-http-response-status) (url-http-handle-cookies) (case class (1 ...
...) (2 ...) (3 ...) (4 ... ...) (5 ... ... ...) (otherwise ...)) (if
(not success) (url-mark-buffer-as-dead buffer)) (url-http-debug
"Finished parsing HTTP headers: %S" success) (widen) success)
  url-http-parse-headers()

Contents of *URL-DEBUG* (when running with debugging turned on):

http -> Contacting host: wwwcache.open.ac.uk:8080
http -> Marking connection as busy: wwwcache.open.ac.uk:8080 #<process
wwwcache.open.ac.uk>
http -> Request is:
POST http://identi.ca/api/statuses/update.xml HTTP/1.1
MIME-Version: 1.0
Connection: close
Extension: Security/Digest Security/SSL
Host: identi.ca
Accept-charset: utf-8;q=1, gb2312;q=0.5, iso-8859-1;q=0.5, big5;q=0.5,
iso-2022-jp;q=0.5, shift_jis;q=0.5, euc-tw;q=0.5, euc-jp;q=0.5,
euc-jis-2004;q=0.5, euc-kr;q=0.5, us-ascii;q=0.5, utf-7;q=0.5,
hz-gb-2312;q=0.5, big5-hkscs;q=0.5, gbk;q=0.5, gb18030;q=0.5,
iso-8859-5;q=0.5, koi8-r;q=0.5, koi8-u;q=0.5, cp866;q=0.5,
koi8-t;q=0.5, windows-1251;q=0.5, cp855;q=0.5, iso-8859-2;q=0.5,
iso-8859-3;q=0.5, iso-8859-4;q=0.5, iso-8859-9;q=0.5,
iso-8859-10;q=0.5, iso-8859-13;q=0.5, iso-8859-14;q=0.5,
iso-8859-15;q=0.5, windows-1250;q=0.5, windows-1252;q=0.5,
windows-1254;q=0.5, windows-1257;q=0.5, cp850;q=0.5, cp852;q=0.5,
cp857;q=0.5, cp858;q=0.5, cp860;q=0.5, cp861;q=0.5, cp863;q=0.5,
cp865;q=0.5, cp437;q=0.5, next;q=0.5, hp-roman8;q=0.5,
adobe-standard-encoding;q=0.5, iso-8859-16;q=0.5, iso-8859-7;q=0.5,
windows-1253;q=0.5, cp737;q=0.5, cp851;q=0.5, cp869;q=0.5,
iso-8859-8;q=0.5, windows-1255;q=0.5, cp862;q=0.5,
iso-2022-jp-2004;q=0.5, cp874;q=0.5, iso-8859-11;q=0.5, viscii;q=0.5,
windows-1258;q=0.5, iso-8859-6;q=0.5, windows-1256;q=0.5,
iso-2022-cn;q=0.5, iso-2022-cn-ext;q=0.5, iso-2022-jp-2;q=0.5,
iso-2022-kr;q=0.5, utf-16le;q=0.5, utf-16be;q=0.5, utf-16;q=0.5,
x-ctext;q=0.5
Accept: */*
User-Agent: URL/Emacs (x86_64-pc-linux-gnu; X11)
Cookie: PHPSESSID=utl76lm4oohk3s7206cl3o9l47
Content-Type: application/xml
Authorization: Basic dXNlcm5hbWU6caFzc3dvcmQ=
Content-length: 22

status='Hi From Emacs'
http -> Calling after change function
`url-http-wait-for-headers-change-function' for `#<process
wwwcache.open.ac.uk>'
http -> url-http-wait-for-headers-change-function ( *http
wwwcache.open.ac.uk:8080*<25>)
http -> Saw end of headers... ( *http wwwcache.open.ac.uk:8080*<25>)
http -> url-http-parse-response called in ( *http wwwcache.open.ac.uk:8080*<25>)
http -> Got a content-length, being smart about document end.
http -> Calling initial content-length for extra data at end of headers
http -> Marking connection as free: identi.ca:80 #<process wwwcache.open.ac.uk>
http -> url-http-parse-headers called in ( *http wwwcache.open.ac.uk:8080*<25>)
http -> url-http-parse-response called in ( *http wwwcache.open.ac.uk:8080*<25>)
http -> Parsed HTTP headers: class=4 status=404



reply via email to

[Prev in Thread] Current Thread [Next in Thread]