Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API suggestion #3

Open
benc-uk opened this issue Dec 2, 2019 · 0 comments
Open

API suggestion #3

benc-uk opened this issue Dec 2, 2019 · 0 comments

Comments

@benc-uk
Copy link
Collaborator

benc-uk commented Dec 2, 2019

I found calling the predict API slightly confusing

I had to provide the application/json content type and include my string inside quotes (otherwise it fell over), it feels halfway between a raw POST API and something that is REST based

Suggestion:

  1. Leave the content type as application/json and have the API accept the text via small JSON object e.g.
{
  "text": "All my text here"
}
  1. Also accept text/plain or unspecified content type, and permit a plain raw string as POST body, e.g.
    curl -X POST -d "Have you seen my hat?" http://localhost:5000/predict

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant