【问题标题】:Switching from CURL to HTTPie. Equivalent of CURL -T从 CURL 切换到 HTTPIE。相当于 CURL -T
【发布时间】:2022-01-11 21:52:39
【问题描述】:

我正在使用集成到 xBase 程序中的 CURL。

我的 curl 命令行包含选项 -T 以将本地文件下载到 CalDAV 日历。我试图在 HTTPIE 中找到它,但没有找到等效的命令。 HTTPIE 在 CURL 中有 -T 之类的选项吗?

【问题讨论】:

    标签: curl httpie xbase clipper


    【解决方案1】:

    来自 cURL 的手册:

           -T, --upload-file <file>
                  This transfers the specified local file to the remote URL.
    

    您似乎正在寻找上传功能。在 HTTPie 中,根据主机服务器的期望,您有多种上传文件的方式:

    A)Redirected input:

    $ http PUT httpbin.org/put Content-Type:image/png < /images/photo.png
    

    B)Request data from a filename(自动设置Content-Type标头):

    $ http PUT httpbin.org/put @/images/photo.png
    

    C)Form file upload:

    $ http --form PUT httpbin.org/put photo=@/images/photo.png
    

    Jakub Roztocil的原始答案。

    【讨论】:

      猜你喜欢
      • 2021-12-16
      • 1970-01-01
      • 1970-01-01
      • 2020-12-23
      • 1970-01-01
      • 2017-06-30
      • 2019-06-14
      • 2021-04-18
      • 1970-01-01
      相关资源
      最近更新 更多