-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
50 lines (40 loc) · 928 Bytes
/
Copy pathclient.py
File metadata and controls
50 lines (40 loc) · 928 Bytes
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
44
45
46
47
48
49
from urllib2 import Request, urlopen
values = """
{
"login": "test",
"password": "test",
"email": "test@test.test"
}
"""
headers = {
'Content-Type': 'application/json'
}
request = Request('http://localhost:8080/api/user', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body
values = """
{
"login": "dima",
"password": "111",
"email": "dima@dima.dima"
}
"""
headers = {
'Content-Type': 'application/json'
}
request = Request('http://localhost:8080/api/user', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body
values = """
{
"login": "admin",
"password": "qwerty",
"email": "ad@ad.ad"
}
"""
headers = {
'Content-Type': 'application/json'
}
request = Request('http://localhost:8080/api/user', data=values, headers=headers)
response_body = urlopen(request).read()
print response_body