26 lines
639 B
Python
26 lines
639 B
Python
from requests import Request, Session
|
|
import hashlib
|
|
import string
|
|
import random
|
|
|
|
s = Session()
|
|
|
|
def id_generator(size=6, chars=string.ascii_lowercase + string.digits):
|
|
return ''.join(random.choice(chars) for _ in range(size))
|
|
|
|
def test():
|
|
data = {
|
|
'orders': [
|
|
{
|
|
'id': 'order_002d2542a1d14de6bc4715fdad05e683',
|
|
'stage': 20,
|
|
}
|
|
],
|
|
}
|
|
req = Request('POST', 'http://localhost/api/v1.0/show-case/import-orders', json=data, auth=('qwe', 'qwe'))
|
|
prepped = req.prepare()
|
|
resp = s.send(prepped)
|
|
print(resp.status_code)
|
|
print(resp.json())
|
|
|
|
test() |