• Windows cURL 获取 Openstack Swift Token


    1. Download CURL for Windows from https://curl.haxx.se/windows/ 

    2. Extract it to a place, such as "C:Program Files".

    3. Open CMD and cd to "C:Program Filescurl-7.69.1-win64-mingwin"

    4. Run "curl xxx" same as in Linux.



    Notice the differences from using in Linux:

    1. The which indicating a same line doesn't apply anymore.

    2. All the ' should be replaced with ".

    3. All the data part (after -d, and inside ""), should replace " with ".

    For example:

    In Linux, the comand looks like:

    curl -i 
      -H "Content-Type: application/json" 
      -d '
    { "auth": {
        "identity": {
          "methods": ["password"],
          "password": {
            "user": {
              "name": "user",
              "domain": { "id": "default" },
              "password": "root"
            }
          }
        },
        "scope": {
          "project": {
            "name": "admin",
            "domain": { "id": "default" }
          }
        }
      }
    }' -k 
      "https://1.1.1.10:5000/v3/auth/tokens"



    In Windows, it should be transferred to 

    curl -i   -H "Content-Type: application/json" -d "{"auth":{"identity":{"methods":["password"],"password":{"user": {"name": "user","domain":{"id":"default"},"password":"root"}}},"scope":{"project":{"name": "admin","domain":{"id": "default" }}}}}" -k "https://1.1.1.10:5000/v3/auth/tokens"

  • 相关阅读:
    Java基础——方法
    JavaScript-JSON解析
    JavaScript—事件
    Window 浏览器窗口对象
    JavaScript 事件
    JavaEE——css字体样式效果
    JavaEE——CSS字体样式
    JavaEE——CSS3选择器
    JavaEE——css边框样式
    JavaEE——XML简介
  • 原文地址:https://www.cnblogs.com/liujx2019/p/13559147.html
Copyright © 2020-2023  润新知