【问题标题】:posting the contents of a markdown file to posterous with curl使用 curl 将 markdown 文件的内容发布到后面
【发布时间】:2012-03-02 23:04:22
【问题描述】:

我想用 curl 推送我的博客文章。我的博文正文包含在降价文件 post.md 中

我正在尝试以下命令:

curl -vX POST --user login:pwd -d "api_token=mytoken" -d post[body]=<post.md -d "post[title]=titre;post[is_private]=true;post[autopost]=false" http://posterous.com/api/2/sites/mysite/posts

帖子是用空的正文(或者更确切地说是“\n”正文)。我该如何解决?

【问题讨论】:

    标签: api curl posterous


    【解决方案1】:

    这行得通:

    curl -vX POST --user login:pwd -d "api_token=mytoken" --data-urlencode "post[body]@post.md" -d "post[title]=titre;post[is_private]=true;post[autopost]=false" http://posterous.com/api/2/sites/mysite/posts
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-23
      • 2018-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-09
      • 2019-02-08
      相关资源
      最近更新 更多