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"

  • 相关阅读:
    Electron+Vue开发跨平台桌面应用
    vue-cli3.0 脚手架搭建项目的过程详解
    dart-sass与node-sass介绍
    创建vue-cli4项目,报错 ERROR command failed: yarn
    CSS Grid 网格布局教程
    总结5种自适应方式
    前端实战:electron+vue3+ts开发桌面端便签应用
    SDK 和 API 的区别是什么?
    Pinia 快速入门
    返回数组中最大的三个数
  • 原文地址:https://www.cnblogs.com/zhao1949/p/7194783.html
Copyright © 2011-2022 走看看