Skip to content

Commit

Permalink
Fix options of `curl' for POST with an empty body.
Browse files Browse the repository at this point in the history
* twittering-mode.el: Fix options of `curl' for POST with an empty
body.
(twittering-start-http-session-curl): add an option "-d" whenever
`method' equals to "POST".
  • Loading branch information
cvmat committed Aug 6, 2010
1 parent 7b15b10 commit dfec772
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
2010-08-06 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el: Fix options of `curl' for POST with an empty
body.
(twittering-start-http-session-curl): add an option "-d" whenever
`method' equals to "POST".

2010-07-25 Tadashi MATSUO <tad@mymail.twin.jp>

* twittering-mode.el (twittering-mode): avoid repeating
Expand Down
21 changes: 12 additions & 9 deletions twittering-mode.el
Expand Up @@ -3804,15 +3804,18 @@ Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
(when (and pair (car pair) (cdr pair))
`("-U" ,(format "%s:%s" (car pair) (cdr pair))))))
,@(when (string= "POST" method)
(apply 'append
(mapcar
(lambda (pair)
(list
"-d"
(format "%s=%s"
(twittering-percent-encode (car pair))
(twittering-percent-encode (cdr pair)))))
parameters)))
(cond
(parameters
(apply 'append
(mapcar
(lambda (pair)
(list
"-d"
(format "%s=%s"
(twittering-percent-encode (car pair))
(twittering-percent-encode (cdr pair)))))
parameters)))
(t '("-d" ""))))
,(concat (funcall request :uri)
(when parameters
(concat "?" (funcall request :query-string))))))
Expand Down

0 comments on commit dfec772

Please sign in to comment.