-
Notifications
You must be signed in to change notification settings - Fork 1
/
awsCRUD.py
43 lines (35 loc) · 1.01 KB
/
awsCRUD.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import json
import requests
root_url = 'http://54.68.184.172:8282/InCSE1'
delete_url = 'http://54.68.184.172:8282/InCSE1'
headers = {'from' : 'http:localhost:10000', 'requestIdentifier' : '12345', 'resultContent' : '1', 'Content-Type' : 'application/json', 'Accept' : 'application/json'}
Data = {
"from": "http:localhost: 10000",
"requestIdentifier": "12345",
"resourceType": "container",
"content":
{
"labels": "cookies" ,
"resourceName": "cn6"
}
}
def printStats():
print r.url
print r.status_code
print r.text
#Simple GET Request
print 'Get Request'
r = requests.get(root_url,params= headers)
printStats()
#Simple DELETE Request
print 'Delete Request'
#r = requests.delete(delete_url,params=headers)
#printStats()
#Simple POST Request
print 'Post Request'
#r = requests.post(root_url, params= headers, data= json.dumps(Data))
#printStats()
#Simple PUT Request
print 'Put Request'
#r = requests.put(root_url, params= headers, data= json.dumps(Data))
#printStats()