# 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)

@@ -394,40 +394,8 @@
 %22: %22
-b3c26c9b0a3f47a584211908c643812a
 %22,%0A 
@@ -434,24 +434,8 @@
 %22: %22
-L2yLC~BZ%5BH/Mzd~1
 %22%0A  
@@ -570,40 +570,8 @@
 %22: %22
-c281af0f80fc4410a02dfe9167a3f284
 %22%0A  

Update swift-post.py