22 lines
742 B
Python
22 lines
742 B
Python
|
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()
|