            (t ""))
      `(,uri))))
 
-(defun org-redmine-curl-post-args (uri data)
-  (let ((args '("-X" "POST" "-s" "-f" "-H" "Content-Type: application/json" "-d")))
+(defun org-redmine-curl-post-args (uri data method)
+  (let ((args '("-s" "-f" "-H" "Content-Type: application/json" "-d")))
     (append
+     (list "-X" method)
      args
      (list data)
      (cond (org-redmine-auth-api-key

         "\"assigned_to_id\":" org-redmine-assignee-id
       "}}")
)
;;------------------------------
;; org-redmine sources for user function
;;------------------------------

                  . (lambda (issue) (org-redmine-insert-subtree issue)))))))
   ))

(defun org-redmine-close-issue ()
  ""
  (interactive)
  (setq issue-id (org-entry-get nil "issue_id"))
  (if issue-id (progn
                     (setq time-entry-data (org-redmine-create-time-entry-json issue-id (/ (org-clock-sum-current-item) 60.0)))
                     (setq time_entry (org-redmine-curl-post (format "%s/time_entries.json" org-redmine-uri) time-entry-data "POST"))
                     (org-redmine-curl-post (format "%s/issues/%s.json" org-redmine-uri issue-id) "{ \"issue\": {\"status_id\":5}}" "PUT")
                     (org-todo "DONE"))    
                     (message "Error: issue_id missing")))

(defun org-redmine-create-issue ()
  ""
  (interactive)
  (let (org-issue issue)
