Votre Convention collective
2013-04-11 19:16:55 GMT
I'm trying to get Drakma working with SBCL. I've loaded it with quicklisp but when I try to connect to a
website in Slime, I get this error:
The function DRAKMA::WITH-CHARACTER-STREAM-SEMANTICS is undefined.
[Condition of type UNDEFINED-FUNCTION]
Any idea what could be causing this? I've attached the backtrace in case that helps.
Thanks,
Patrick
Backtrace:
0: ("undefined function")
1: (HTTP-REQUEST #<PURI:URI http://ichart.yahoo.com/table.csv?s=IBM&a=0&b=01&c=2012&d=11&e=31&f=2012&g=d&ignore=.csv>)
2: (GET-YAHOO-SYMBOL-DATA "IBM" "2012-01-01" "2012-12-31")
3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (GET-YAHOO-SYMBOL-DATA "IBM" "2012-01-01" "2012-12-31") #<NULL-LEXENV>)
4: (EVAL (GET-YAHOO-SYMBOL-DATA "IBM" "2012-01-01" "2012-12-31"))
5: ((LAMBDA () :IN SWANK:EVAL-AND-GRAB-OUTPUT))
6: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME evaluation request." #<CLOSURE (LAMBDA # :IN
SWANK:EVAL-AND-GRAB-OUTPUT) {13BBF7E5}>)
7: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA # :IN SWANK:EVAL-AND-GRAB-OUTPUT) {13BBF7CD}>)
8: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:EVAL-AND-GRAB-OUTPUT "(get-yahoo-symbol-data \"IBM\"
\"2012-01-01\" \"2012-12-31\")\n") #<NULL-LEXENV>)
9: (EVAL (SWANK:EVAL-AND-GRAB-OUTPUT "(get-yahoo-symbol-data \"IBM\" \"2012-01-01\" \"2012-12-31\")\n"))
10: (SWANK:EVAL-FOR-EMACS (SWANK:EVAL-AND-GRAB-OUTPUT "(get-yahoo-symbol-data \"IBM\"
\"2012-01-01\" \"2012-12-31\")\n") ":comp-invest" 17)
11: (SWANK::PROCESS-REQUESTS T)
12: (SWANK::CALL-WITH-BINDINGS ..)
13: (SWANK::REPL-INPUT-STREAM-READ #<SWANK::SINGLETHREADED-CONNECTION {12971A59}>
#<SB-SYS:FD-STREAM for "standard input" {11A91B11}>)
14: ((LAMBDA () :IN SB-GRAY:STREAM-READ-CHAR))
15: ((SB-PCL::FAST-METHOD SB-GRAY:STREAM-READ-CHAR (SWANK-BACKEND::SLIME-INPUT-STREAM))
#<unavailable argument> #<unavailable argument> #<SWANK-BACKEND::SLIME-INPUT-STREAM {12971BC9}>)
16: (READ-CHAR #<SWANK-BACKEND::SLIME-INPUT-STREAM {12971BC9}> T #:EOF-OBJECT #<unused argument>)
17: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SWANK-BACKEND::SLIME-INPUT-STREAM {12971BC9}> T NIL T)
18: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SWANK-BACKEND::SLIME-INPUT-STREAM {12971BC9}> T NIL NIL)
19: (READ #<SWANK-BACKEND::SLIME-INPUT-STREAM {12971BC9}> T NIL NIL)
20: (SWANK::SIMPLE-REPL)
21: ((LAMBDA () :IN SWANK::SIMPLE-SERVE-REQUESTS))
22: ((LAMBDA () :IN SWANK::SIMPLE-SERVE-REQUESTS))
23: ((LAMBDA (SWANK-BACKEND::HANDLER FUNCTION) :IN
"/Users/Patrick/.emlib/slime/swank-backend.lisp") ..)
24: (SWANK-BACKEND::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE
(LAMBDA # :IN SWANK::SIMPLE-SERVE-REQUESTS) {12971ACD}>)
25: ((FLET SWANK-BACKEND:CALL-WITH-DEBUGGER-HOOK :IN
"/Users/Patrick/.emlib/slime/swank-sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK>
#<CLOSURE (LAMBDA # :IN SWANK::SIMPLE-SERVE-REQUESTS) {12971ACD}>)
26: (SWANK::SIMPLE-SERVE-REQUESTS #<SWANK::SINGLETHREADED-CONNECTION {12971A59}>)
27: (SWANK::ACCEPT-CONNECTIONS #<SB-BSD-SOCKETS:INET-SOCKET fd: -1 {129680D1}> NIL NIL)
28: ((LABELS SWANK::SERVE-LOOP :IN SWANK::SETUP-SERVER))
29: (SWANK::SETUP-SERVER 0 #<CLOSURE (LAMBDA # :IN SWANK:START-SERVER) {128E5F1D}> NIL NIL NIL)
30: (SB-INT:SIMPLE-EVAL-IN-LEXENV (FUNCALL (READ-FROM-STRING "swank:start-server")
"/var/folders/b0/br9v722s5nq0j4m677ncd98c0000gn/T/slime.32805") #<NULL-LEXENV>)
31: (SB-INT:SIMPLE-EVAL-IN-LEXENV ..)
32: (EVAL ..)
33: (SB-EXT:INTERACTIVE-EVAL ..)
34: (SB-IMPL::REPL-FUN NIL)
35: ((LAMBDA () :IN SB-IMPL::TOPLEVEL-REPL))
36: (SB-IMPL::%WITH-REBOUND-IO-SYNTAX #<CLOSURE (LAMBDA # :IN SB-IMPL::TOPLEVEL-REPL) {13363095}>)
37: (SB-IMPL::TOPLEVEL-REPL NIL)
38: (SB-IMPL::TOPLEVEL-INIT)
39: ((FLET #:WITHOUT-INTERRUPTS-BODY-222031 :IN SB-EXT:SAVE-LISP-AND-DIE))
40: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))
Hi everybody,
_______________________________________________ drakma-devel mailing list drakma-devel <at> common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
Hi, while fixing some bugs in Drakma recently, I was notified that the documentation and the docstrings were not matching well anymore. I have decided to overhaul the documentation, and in the process of that, I also made some source changes. There will be more changes soon, so you may experience instabilities when you're using the master branch from github. Comments regarding the documentation would be very welcome, I have put a version up for review at http://netzhansa.com/drakma.html Thanks, Hans
When parsing this Set-Cookie line: Set-Cookie: shssl=4058628; path=/; secure; HttpOnly The resulting Cookie is: #<COOKIE shssl=4058628; path=/; domain=www.base.de> Which misses both features: 'HttpOnly' and 'secure'. I traced the bug down to 'parse-set-cooie' which returns (("Set-Cookie: shssl" "4058628" (("path" . "/") ("secure; HttpOnly")))) instead of (("Set-Cookie: shssl" "4058628" (("path" . "/") ("secure") ("HttpOnly")))) As far as I understood the code the problem is caused by 'read-name-value-pairs' of chunga. I am using chunga 1.1.1 and drakma 1.2.9 Is this a already known bug/problem?
(http-request "http://www.walmart.com")It will display the following:
(http-request "http://www.walmart.com" :external-format-in :UTF-8)and it will solve he problem. But this particular example does not lend itself to this, at least using the following charsets:
_______________________________________________ drakma-devel mailing list drakma-devel <at> common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
Hi, I have released Drakma 1.2.7 yesterday. The following changes have been made since 1.2.6: Support :REPORT method (Cyrus Harmon) Make PRESERVE-URI work better - PURI:URI mangles paths with encoded &'s. The release tarball can be found here: https://github.com/downloads/edicl/drakma/drakma-1.2.7.tar.gz (or on the canonical URLhttp://weitz.de/files/drakma.tar.gz, which always points to the latest release). -Hans
Here is a complete discussion on the character set of cookie name (for python development):
http://bugs.python.org/issue2193
I think drakma should follow python's work.
In file "util.lisp" of drakma, function split-set-cookie-string splits cookie string using function is-valid-cookiename-char which comes from chunga.
But function is-valid-cookiename-char just follow RFC2616 which rules that chars of cookie name are legal when they are in token set ( see bellow).
_______________________________________________ drakma-devel mailing list drakma-devel <at> common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
Sorry to resurrect an old thread, Carlos.
On Wed, Oct 14, 2009 at 12:04 AM, Carlos Konstanski
<ckonstan... <at> pippiandcarlos.com> wrote:
> Is there any way to get drakma to write an NTLM auth header? I am
> unfortunately trying to communicate with a .NET web service in an
> Active Directory environment.
>
> If not, I suppose I could use Ã`additional-headers' to write one
> myself.
Were you successful in rolling your own headers? I’m stuck at the moment, figuring what needs to be done.
Thanks,
Brian C.
_______________________________________________ drakma-devel mailing list drakma-devel <at> common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
I have been trying to get my lisp application to interface and upload a file to my drupal 7 website using Drakma. So far I have been able to to connect to my drupal site and authenticate and store the session cookie (thank you Ryan Davis, I just found your response the other day). Here is the code I use to do that: (with-output-to-string (stream) (setf drakma:*header-stream* stream) (let ((cookie-jar (make-instance 'drakma:cookie-jar))) (drakma:http-request "http://localhost:8888/?q=rest/user/login" :method :post :cookie-jar cookie-jar :parameters '(("username" . "login") ("password" . "password")) ) (drakma:http-request "http://localhost:8888/?q=rest/file" :method :post :cookie-jar cookie-jar :content-length t :parameters '(("file1" . #p"/Users/Mike/hello.png"));("file1" #p"/Users/Mike/Desktop/mario-gif.gif" :content-type "image/gif" :filename "mario-gif.gif")) :content-type "application/x-www-form-urlencoded" ;:parameters ))) This code successfully sends both posts but the second post does not actually upload the file (but it does return 200 OK, no errors). I have successfully uploaded to by drupal site using PHP Curl and in that code, I was only able to get it to work by using a content type of application/x-www-form-urlencoded (if I use a multipart/form-data request on my php page I get similar behavior to what I am now seeing with Drakma). This is why I added the line :content-type "application/x-www-form-urlencoded" to my second request (posted above) but it seems to have no effect. Here is a copy of the posts I am making (as you can see in the second post it still uses multipart/form-data. Is there anyway that I can upload a file using Drakma using a content-type of application/x-www-form-urlencoded (I know this is not the recommended way of making this type of request but I think it may be the only way that my drupal site will accept the file). "POST /?q=rest/user/login HTTP/1.1 Host: localhost:8888 User-Agent: Drakma/1.2.3 (Clozure Common Lisp Version 1.7-r14927M (DarwinX8664); Darwin; 10.8.0; http://weitz.de/drakma/) Accept: */* Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 34 HTTP/1.1 200 OK Date: Thu, 15 Mar 2012 17:49:51 GMT Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 X-Powered-By: PHP/5.3.6 Expires: Sun, 19 Nov 1978 05:00:00 GMT Last-Modified: Thu, 15 Mar 2012 17:49:51 +0000 Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 ETag: \"1331833791\" Vary: Accept Set-Cookie: SESSdc0685ed01f285dab628a3700259e6bc=oIJFlVrfoXi-PO7bdwKtauKfTeRSEK1iIucj0tl12UQ; expires=Sat, 07-Apr-2012 21:23:12 GMT; path=/; HttpOnly Content-Length: 115 Connection: close Content-Type: text/yaml POST /?q=rest/file HTTP/1.1 Host: localhost:8888 User-Agent: Drakma/1.2.3 (Clozure Common Lisp Version 1.7-r14927M (DarwinX8664); Darwin; 10.8.0; http://weitz.de/drakma/) Accept: */* Cookie: SESSdc0685ed01f285dab628a3700259e6bc=oIJFlVrfoXi-PO7bdwKtauKfTeRSEK1iIucj0tl12UQ Connection: close Content-Type: multipart/form-data; boundary=----------ndnZ9xjDrDpzStPEQo97xwqPHEKXAhAOd8Ho6C8P3jtKbvNINm Content-Length: 244958 HTTP/1.1 200 OK Date: Thu, 15 Mar 2012 17:49:52 GMT Server: Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6 X-Powered-By: PHP/5.3.6 Expires: Sun, 19 Nov 1978 05:00:00 GMT Last-Modified: Thu, 15 Mar 2012 17:49:52 +0000 Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0 ETag: \"1331833792\" Vary: Accept Content-Length: 4 Connection: close Content-Type: text/yaml " Thanks, --Michael
_______________________________________________ drakma-devel mailing list drakma-devel <at> common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/drakma-devel
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 |
RSS Feed1 | |
|---|---|
14 | |
2 | |
5 | |
2 | |
1 | |
2 | |
9 | |
5 | |
9 | |
1 | |
1 | |
15 | |
4 | |
5 | |
1 | |
2 | |
2 | |
6 | |
8 | |
8 | |
7 | |
3 | |
6 | |
7 | |
8 | |
8 | |
5 | |
1 | |
3 | |
5 | |
17 | |
10 | |
3 | |
5 | |
15 | |
23 | |
11 | |
8 | |
15 | |
15 | |
13 | |
5 | |
17 | |
20 | |
14 | |
11 | |
23 | |
10 | |
22 | |
10 | |
32 |