Created
March 7, 2017 20:09
-
-
Save tingley/dc968411d12c348949b2741bc54a65fe to your computer and use it in GitHub Desktop.
Calling longhorn API from 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 | |
url = 'http://localhost:8080/okapi-longhorn/' | |
response = requests.post(url+'projects/new') | |
# create a new project | |
response = requests.get(url+'projects/') | |
# push a file | |
payload = "hello world!" | |
headers = {'accept-encoding': 'multipart/form-data', 'content-type': 'text/html'} | |
response = requests.put(url+'projects/1/inputFiles/test2.html', files=dict(inputFile=payload)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment