Created
February 17, 2022 01:06
-
-
Save andrewdoss-bit/6c7643eea4b9a961ad677992eab59240 to your computer and use it in GitHub Desktop.
Python import example
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 | |
with open("$PATH_TO_FILE", 'rb') as f: | |
data = f.read() | |
url = 'https://import.bit.io/$USERNAME/$REPO_NAME/$TABLE_NAME' | |
headers = { | |
"Content-Disposition": "attachment;filename='test.csv'", | |
"Authorization": "Bearer $TOKEN" | |
} | |
response = requests.request("POST", url, headers=headers, data=data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment