• curl传输文件实例


    curl -H "Authorization:Bearer 5d719398-4230-44c7-b88b-f280b6a8d070" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "metadata=@test.json; name=story; type=application/json; charset=UTF-8 "  -X POST http://mypath/postpath -i -v


    curl -H "Authorization:Bearer 5d719398-4230-44c7-b88b-f280b6a8d070" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "name=story; metadata=@test.json; type=application/json; charset=UTF-8 "  -X POST http://mypath/postpath -i -v

    only json
    curl -H "Authorization:Bearer f19fd8c5-d64b-4ed5-bf09-556684fcc235" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_t1.json; type=application/json;charset=UTF-8 "  -X POST http://mypath/postpath -i -v
    ok

    curl  -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_t1.json; type=application/json;charset=UTF-8 "  -X POST http://mypath/postpath -i -v
    ok



    test jpg
    curl -H "Authorization:Bearer 5d719398-4230-44c7-b88b-f280b6a8d070" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_jpg.json; type=application/json;charset=UTF-8 " -F "files=@att1.jpg; type=image/jpg"  -X POST http://mypath/postpath -i -v
    ok
    test 2 jpgs
    curl -H "Authorization:Bearer 5d719398-4230-44c7-b88b-f280b6a8d070" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_2jpg.json; type=application/json;charset=UTF-8 " -F "files=@att1.jpg; type=image/jpg" -F "files=@att2.jpg; type=image/jpg" -X POST http://mypath/postpath -i -v
    ok


    curl  -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_t1.json; type=application/json;charset=UTF-8 "  -X POST http://mypath/postpath -i -v




    curl  -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_500.json; type=application/json;charset=UTF-8 "  -X POST http://mypath/postpath -i -v


    curl -H "Authorization:Bearer 5d719398-4230-44c7-b88b-f280b6a8d070" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_jpg.json; type=application/json;charset=UTF-8 "   -X POST http://mypath/postpath -i -v




    curl -H "Authorization:Bearer 5d719398-4230-44c7-b88b-f280b6a8d070" -H "Accept: application/json" -H "Content-Type: multipart/mixed" -F "story=@story_jpg2.json; type=application/json;charset=UTF-8 " -F "files=@att1.jpg; type=image/jpg"  -X POST http://mypath/postpath -i -v


    curl -H 'Content-Type:text/plain' --data-binary @urls.txt "http://www.xxx.com/urls"

  • 相关阅读:
    如何将程序集(dll)安装到全局程序集缓存(GAC)中
    当 ftp 遇上 http Proxy
    sql server 2008 帶主鍵table 字段 數據類型修改
    SQL 按指定顺序进行排序
    当发布时报错: 找不到 obj\Debug\Package\PackageTmp\xxx.aspx 文件
    c# 简体 繁体 转换
    SQL SERVER 简体与繁体 定序 轉換
    匿名类型与Lambda表达式
    使用委托实现了在循环中调用不同的方法
    学习源代码的心得
  • 原文地址:https://www.cnblogs.com/zhao1949/p/7194783.html
Copyright © 2020-2023  润新知