# coding: utf-8
import requests

def swift_auth():
    url = 'https://lon-identity.open.softlayer.com/v3/auth/tokens'
    headers={'Content-Type': 'application/json'}
    data = '''{
        "auth": {
            "identity": {
                "methods": [
                    "password"
                ],
                "password": {
                    "user": {
                        "id": "b3c26c9b0a3f47a584211908c643812a",
                        "password": "L2yLC~BZ[H/Mzd~1"
                    }
                }
            },
            "scope": {
                "project": {
                    "id": "c281af0f80fc4410a02dfe9167a3f284"
                }
            }
        }
    }'''

    response = requests.post(url, data=data, headers=headers)
    #print (response.json())
    #print (response.headers)
    #print (response.headers['X-Subject-Token'])
    #print (response.json()['token']['catalog'][0]['endpoints'][0]['url'])

    return response

def swift_get(response):
    token = response.headers['X-Subject-Token']
    endpoint = response.json()['token']['catalog'][7]['endpoints'][3]['url']
    headers = {'X-Auth-Token': token}

    response = requests.get(endpoint, headers=headers)
    print (response.status_code)
    print (response.headers)
    print (response.text)

if __name__ == "__main__":
    auth_resp = swift_auth()
    swift_get(auth_resp)

@@ -1117,16 +1117,50 @@
 %5B'url'%5D%0A
+    endpoint = endpoint + '/test'%0A
     head
@@ -1189,16 +1189,16 @@
  token%7D%0A
-
 %0A    res
@@ -1334,16 +1334,624 @@
 .text)%0A%0A
+def swift_put(response):%0A    token = response.headers%5B'X-Subject-Token'%5D%0A    endpoint = response.json()%5B'token'%5D%5B'catalog'%5D%5B7%5D%5B'endpoints'%5D%5B3%5D%5B'url'%5D%0A    endpoint = endpoint + '/test/python-test.txt'%0A    headers = %7B'X-Auth-Token': token, 'Content-Type': 'text/plain'%7D%0A    params = %7B'file': 'python-test.txt'%7D%0A%0A    with open('./python-test.txt') as textFile:%0A        mydata = textFile.read()%0A        files = %7B'python-test.txt': mydata%7D%0A        response = requests.put(endpoint, headers=headers, files=files)%0A        print (response.status_code)%0A        print (response.headers)%0A        print (response.text)%0A%0A
 if __nam
@@ -1998,16 +1998,16 @@
 _auth()%0A
-
     swif
@@ -2023,8 +2023,33 @@
 h_resp)%0A
+    swift_put(auth_resp)%0A

Add put