Skip to content

Instantly share code, notes, and snippets.

@avloss
Last active March 10, 2017 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avloss/9fa498a47d864a2d73dc50c27ebfdde8 to your computer and use it in GitHub Desktop.
Save avloss/9fa498a47d864a2d73dc50c27ebfdde8 to your computer and use it in GitHub Desktop.
import numpy as np
import cPickle as pickle
import requests
def test_flask_client(x):
URL = "http://localhost:8915/model_prediction"
s = pickle.dumps({"x":x}, protocol=0)
DATA = {"model_name": "default",
"input": requests.utils.quote(s)}
r = requests.get(URL, data=DATA)
return r.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment