Skip to content

Instantly share code, notes, and snippets.

@hughdbrown
Created March 7, 2018 16:16
Show Gist options
  • Save hughdbrown/1374ae735a994946ac9e18d9bdfd19a3 to your computer and use it in GitHub Desktop.
Save hughdbrown/1374ae735a994946ac9e18d9bdfd19a3 to your computer and use it in GitHub Desktop.
Predictions API usage from command line
#!/bin/sh
# Cat a JSON file and send it as the data argument to curl in a
# POST request to DataRobot prediction API
cat <JSON-FILE> |
curl -H "Content-Type: application/json" \
-X POST -d @- \
-u <USER-NAME>:<API-KEY> \
http://<HOST>/predApi/v1.0/<PROJECT-ID>/<MODEL-ID>/predict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment