[clouchdb-devel] basic-authorization
Peter Eddy
peter.eddy at gmail.com
Mon Apr 19 01:08:02 UTC 2010
Hi,
I think I've added something similar in source control, but not in a
released version. I'll have to check. If not, I'll incorporate your
patch and make a new release soon.
thanks,
Peter
2010/4/16 Knut Olav Bøhmer <bohmer at gmail.com>:
> Hi,
>
> What about enabeling basic-authorization. This worked for me:
>
>
> (defun db-request (uri &rest args &key &allow-other-keys)
> "Used by most Clouchdb APIs to make the actual REST request."
> (let ((*text-content-types* *text-types*))
> (multiple-value-bind (body status headers uri stream must-close
> reason-phrase)
> (apply #'drakma:http-request (make-uri uri)
> `(, at args :basic-authorization
> ,(when (db-user *couchdb*)
> (list (db-user *couchdb*)
> (db-password *couchdb*)))))
>
> ;;(declare (ignore must-close reason-phrase stream uri headers status))
> (when *debug-requests*
> (format t "uri: ~s~%args: ~s~%must-close:~s~%reason-phrase:
> ~s~%status: ~s~%headers: ~s~%stream:~s~%body:~s~%" uri args
> must-close reason-phrase status headers stream body))
> (if (stringp body)
> (json-to-document body)
> (values body status reason-phrase)))))
>
>
> --
> Knut Olav Bøhmer
>
> _______________________________________________
> clouchdb-devel mailing list
> clouchdb-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/clouchdb-devel
>
More information about the clouchdb-devel
mailing list