pub1c-web/test.py

22 lines
742 B
Python
Raw Normal View History

2021-05-21 12:19:11 +00:00
from requests import put, get, post, delete
import json
from pprint import pformat
api='http://localhost:5000/api/v1/'
def main():
#print(api, get(api).json())
#print(api+'infobases', get(api+'infobases').json())
#print(api+'publications', get(api+'publications').json())
res = put(api+'publications', data={'name': 'test3'})
print('put', api+'publications', res.status_code, pformat(res.json()))
res = delete(api + 'publications/test3', data={'name': 'test3'})
print('delete', api + 'publications/test3', res.status_code, pformat(res.json()))
#res = get(api + 'publications/test1')
#print('GET', api + 'publications/test1', res.status_code, pformat(res.json()))
if __name__ == '__main__':
main()