Skip to content

Instantly share code, notes, and snippets.

@andrewdoss-bit
Created February 17, 2022 01:06
Show Gist options
  • Save andrewdoss-bit/6c7643eea4b9a961ad677992eab59240 to your computer and use it in GitHub Desktop.
Save andrewdoss-bit/6c7643eea4b9a961ad677992eab59240 to your computer and use it in GitHub Desktop.
Python import example
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