mirror of https://github.com/apache/jclouds.git
Added sign-blob-request overload for default get request
This commit is contained in:
parent
b7307add04
commit
af094f6ffe
|
@ -241,11 +241,14 @@ Options can also be specified for extension modules
|
|||
|
||||
(defn sign-blob-request
|
||||
"Get a signed http request for manipulating a blob in another application.
|
||||
ex. curl.
|
||||
ex. curl. The default is for a :get request.
|
||||
The request argument is used to specify charecteristics of the request
|
||||
to be signed. The :method key must be set to one of :get, :delete, and
|
||||
:put. For :put requests, :content-length must be specified. Optionally,
|
||||
:content-type and content-md5 may be given."
|
||||
:content-type, :content-disposition, :content-language, :content-encoding
|
||||
and :content-md5 may be given."
|
||||
([container-name path]
|
||||
(sign-blob-request container-name path {:method :get} *blobstore*))
|
||||
([container-name path
|
||||
{:keys [method content-type content-length content-md5
|
||||
content-disposition content-encoding content-language] :as request}]
|
||||
|
|
|
@ -112,9 +112,15 @@
|
|||
(deftest sign-blob-request-test
|
||||
(testing "delete"
|
||||
(let [request (sign-blob-request "container" "path" {:method :delete})]
|
||||
(is (= "http://localhost/container/path" (str (.getEndpoint request))))
|
||||
(is (= "DELETE" (.getMethod request)))))
|
||||
(testing "default request"
|
||||
(let [request (sign-blob-request "container" "path")]
|
||||
(is (= "http://localhost/container/path" (str (.getEndpoint request))))
|
||||
(is (= "GET" (.getMethod request)))))
|
||||
(testing "get"
|
||||
(let [request (sign-blob-request "container" "path" {:method :get})]
|
||||
(is (= "http://localhost/container/path" (str (.getEndpoint request))))
|
||||
(is (= "GET" (.getMethod request)))))
|
||||
(testing "put"
|
||||
(let [request (sign-blob-request
|
||||
|
|
Loading…
Reference in New Issue