Created
May 10, 2017 07:53
-
-
Save alfredfrancis/f8d752611f453572d1d2c25b22286a25 to your computer and use it in GitHub Desktop.
Upload files to MongoDB GridFS using Restheart API and 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 | |
# https://softinstigate.atlassian.net/wiki/pages/viewpage.action?pageId=11567174= | |
files = { | |
'file': open("helloworld.mp3", 'rb') | |
} | |
values={ | |
'properties':'"filename":"helloworld.mp3"') | |
} | |
#Collection name should end with files | |
result= requests.post('http://restheartInstance:port/dbname/collectionname.files', files=files ,data=values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment