Created
August 31, 2019 02:49
-
-
Save vershimajr/080725f0cdaac30c3f076b0d707eec13 to your computer and use it in GitHub Desktop.
Post File To Temporal with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
prod_pin_url = 'https://api.temporal.cloud/v2/ipfs/public/file/add' | |
headers = {'Cache-Control':'no-cache', 'Authorization':'Bearer '+'AUTH_TOKEN_STRING',} | |
files = {'file': open('FILENAME','rb')} | |
data = {'hold_time':'HOLD_TIME_INT'} | |
r = requests.post(prod_pin_url,headers=headers,files=files,data=data) | |
ipfs_hash = r.json()['response'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment