Skip to content
Browse files

use drakma :parameters keyword to pass in the uri's parameters

Parameters were encoded and aded on to the uri. This caused drakma to
encode this twice for the get commands..
Using :parameters seems cleaner
  • Loading branch information...
1 parent b4156ec commit cd077367b3b9f73cfb34e7bf5ebca5621e48e4a0 @fons fons committed Jan 8, 2012
Showing with 20 additions and 19 deletions.
  1. +20 −19 src/core/consumer.lisp
View
39 src/core/consumer.lisp
@@ -20,25 +20,26 @@ it has query params already they are added onto it."
(defun http-request (uri &key (request-method :get) parameters drakma-args)
;; TODO handle redirects properly
- (let* ((param-string-encoded (alist->query-string parameters :include-leading-ampersand nil :url-encode t)))
- (case request-method
- (:get
- (apply #'drakma:http-request
- (uri-with-additional-query-part uri param-string-encoded)
- :method request-method
- drakma-args))
- (:post
- (apply #'drakma:http-request
- uri
- :method request-method
- :content param-string-encoded
- drakma-args))
- (:auth
- (apply #'drakma:http-request
- uri
- :method :get
- :additional-headers `(("Authorization" . ,(build-auth-string parameters)))
- drakma-args)))))
+ (case request-method
+ (:get
+ (apply #'drakma:http-request
+ uri
+ :parameters parameters
+ :method request-method
+ drakma-args))
+ (:post
+ (apply #'drakma:http-request
+ uri
+ :method request-method
+ :parameters parameters
+ ;;:content param-string-encoded
+ drakma-args))
+ (:auth
+ (apply #'drakma:http-request
+ uri
+ :method :get
+ :additional-headers `(("Authorization" . ,(build-auth-string parameters)))
+ drakma-args))))
(defun obtain-request-token (uri consumer-token
&key (version :1.0) user-parameters drakma-args

0 comments on commit cd07736

Please sign in to comment.
Something went wrong with that request. Please try again.