You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.8 KiB
101 lines
2.8 KiB
{ |
|
"cells": [ |
|
{ |
|
"cell_type": "code", |
|
"execution_count": null, |
|
"id": "39df3cd3-d7d7-45f2-9c7c-f018e03cfdb1", |
|
"metadata": { |
|
"scrolled": true, |
|
"tags": [] |
|
}, |
|
"outputs": [], |
|
"source": [ |
|
"import json\n", |
|
"import requests\n", |
|
"input_set = []\n", |
|
"\n", |
|
"with open('pages.json', 'r') as input:\n", |
|
" input_set = json.load(input)\n", |
|
"# print(input_set)\n", |
|
"\n", |
|
"my_headers = {'Authorization': os.env(directus_token),'Content-Type': 'application/json'}\n", |
|
"\n", |
|
"response = requests.post('https://cms.donavanaldrich.com/items/pages', headers=my_headers, json=(input_set))\n", |
|
"\n", |
|
"# # # response = requests.post('https://httpbin.org/post', data = {'key':'value'})\n", |
|
"print(response.json())" |
|
] |
|
}, |
|
{ |
|
"cell_type": "code", |
|
"execution_count": null, |
|
"id": "c3eb47fb-926c-4d6f-a080-64cf94e20e24", |
|
"metadata": {}, |
|
"outputs": [], |
|
"source": [ |
|
"import json\n", |
|
"import requests\n", |
|
"# input_set = []\n", |
|
"\n", |
|
"# with open('cards.json', 'r') as input:\n", |
|
"# input_set = json.load(input)\n", |
|
"# print(input_set)\n", |
|
"\n", |
|
"my_headers = {'Authorization': os.env(directus_token),'Content-Type': 'application/json'}\n", |
|
"\n", |
|
"response = requests.post('https://content.donavanaldrich.com/items/cards', headers=my_headers, json=(input_set))\n", |
|
"\n", |
|
"# # # response = requests.post('https://httpbin.org/post', data = {'key':'value'})\n", |
|
"print(response.json())\n", |
|
"\n", |
|
"import json\n", |
|
"import requests\n", |
|
"# input_set = []\n", |
|
"\n", |
|
"# with open('cards.json', 'r') as input:\n", |
|
"# input_set = json.load(input)\n", |
|
"# print(input_set)\n", |
|
"\n", |
|
"my_headers = {'Authorization': os.env(directus_token),'Content-Type': 'application/json'}\n", |
|
"\n", |
|
"response = requests.post('https://content.donavanaldrich.com/items/cards', headers=my_headers, json=(input_set))\n", |
|
"\n", |
|
"# # # response = requests.post('https://httpbin.org/post', data = {'key':'value'})\n", |
|
"print(response.json())\n", |
|
"# input_set = []\n", |
|
"\n", |
|
"# with open('cards.json', 'r') as input:\n", |
|
"# input_set = json.load(input)\n", |
|
"# # print(input_set)" |
|
] |
|
} |
|
], |
|
"metadata": { |
|
"kernelspec": { |
|
"display_name": "Python 3 (ipykernel)", |
|
"language": "python", |
|
"name": "python3" |
|
}, |
|
"language_info": { |
|
"codemirror_mode": { |
|
"name": "ipython", |
|
"version": 3 |
|
}, |
|
"file_extension": ".py", |
|
"mimetype": "text/x-python", |
|
"name": "python", |
|
"nbconvert_exporter": "python", |
|
"pygments_lexer": "ipython3", |
|
"version": "3.9.12" |
|
}, |
|
"widgets": { |
|
"application/vnd.jupyter.widget-state+json": { |
|
"state": {}, |
|
"version_major": 2, |
|
"version_minor": 0 |
|
} |
|
} |
|
}, |
|
"nbformat": 4, |
|
"nbformat_minor": 5 |
|
}
|
|
|