-
Notifications
You must be signed in to change notification settings - Fork 835
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
Why seldon chose application/x-www-form-urlencoded as Content-Type instead of application/json when treating predict requests? #935
Comments
We have both. seldon-core/engine/src/main/java/io/seldon/engine/api/rest/RestClientController.java Line 140 in 174431a
Please reopen if I misinterpreted you. |
Thanks @cliveseldon ,How can I post data to predict interface use application/json?
And in the microservice/microservice.py file in the seldonio/seldon-core-s2i-python3 image, I find this (line 47 - 55): def extract_message():
jStr = request.form.get("json")
if jStr:
message = json.loads(jStr)
else:
raise SeldonMicroserviceException("Empty json parameter in data")
if message is None:
raise SeldonMicroserviceException("Invalid Data Format")
return message It means if user post data not in the form data which key is json server will raise empty json parameter error. Is there any example about how to post data with application/json? |
You can use POST as well:
|
Which version of Seldon are you using. This has changed.
|
@blublinsky I think this is what you had been talking about in regards to the form/json ^ |
This is what worked for me: |
I just find seldon use application/x-www-form-urlencoded instead of application/json, this make me confused, in my opinion , I should use json as data for both input and out datatype.
What pros and cons when treating ml predict requests using application/x-www-form-urlencoded and application/json?
I find some discussion about this:https://stackoverflow.com/questions/11281117/x-www-form-urlencoded-vs-json-http-post
The text was updated successfully, but these errors were encountered: