zoukankan      html  css  js  c++  java
  • 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"

  • 相关阅读:
    mongoose 报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead
    node
    node
    CSS
    JS
    Express
    java Map按Key排序
    Jedis(三)——Hash/List/Set
    Java 四种线程池newCachedThreadPool,newFixedThreadPool,newScheduledThreadPool,newSingleThreadExecutor
    java中如何给Runnable线程传递参数?
  • 原文地址:https://www.cnblogs.com/zhao1949/p/7194783.html
Copyright © 2011-2022 走看看