          (message "%s: Non JSON data because of a server side exception. See %s"
                   (error-message-string err) org-redmine-curl-buffer))))))
 
-(defun org-redmine-curl-post (uri data)
+(defun org-redmine-curl-post (uri data method)
   ""
   (ignore-errors (kill-buffer org-redmine-curl-buffer))
   (unless (eq 0 (apply 'call-process "curl" nil `(,org-redmine-curl-buffer nil) nil
-                       (org-redmine-curl-post-args uri data)
+                       (org-redmine-curl-post-args uri data method)
                        ))
     (signal 'org-redmine-exception-not-retrieved "The requested URL returned error"))
   (save-current-buffer

           (t ""))
     `(,uri))))

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

    (let ((json-object-type 'hash-table)
          (json-array-type 'list))
      (condition-case err
            (unless (string= (replace-regexp-in-string "\\`[ \t\n]*" "" (replace-regexp-in-string "[ \t\n]*\\'" "" (buffer-string))) "")
            (json-read-from-string (buffer-string)))
        (json-readtable-error
         (message "%s: Non JSON data because of a server side exception. See %s"
                  (error-message-string err) org-redmine-curl-buffer))))))

          ;;(setq trimed-string (replace-regexp-in-string "\\`[ \t\n]*" "" (replace-regexp-in-string "[ \t\n]*\\'" "" (buffer-string))))
        ;;(unless (eq (replace-regexp-in-string "\\`[ \t\n]*" "" (replace-regexp-in-string "[ \t\n]*\\'" "" (buffer-string))) "")

(defun org-redmine-curl-args (uri)
  (let ((args '("-X" "GET" "-s" "-f")))
