This message was deleted.
# ask-for-help
s
This message was deleted.
j
Make sure the client meets https://www.rfc-editor.org/rfc/rfc1867
y
@Jiang I am using Postman to send the POST API request. I am using form-data (Content Type: application/x-www-form-urlencoded) and I have a file included in the arguments.
j
This may be helpful to you https://stackoverflow.com/a/41435972
y
I am sending the POST request appropriately. It still sends the same exception. Here is how it looks like in the Postman:
j
Is the curl example on the swagger page working?
y
No
j
Is the curl example on the swagger page working?
y
When I send the request from the Swagger page it works. I will try to implement that API definition and see if it works. I wanted to ask also if it is possible to have as input multiple files as input (without a defined amount)
j
It's not supported by MultipartIO. Could you share us the case that requires variable io parameters?
y
Is there a way for me to accept multiple files? You had this in v0.13 I need it for one of my endpoints
j
Accepting multiple files (fixed amount) is supported
y
This is how it is solved in the swagger page:
Copy code
curl -X 'POST' \
  '<http://172.16.4.174:5000/predict_example5>' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -F 'files_stream=@4.jpg;type=image/jpeg' \
  -F 'form_stream={"sid": "S0RjcTI2RjNQYjBZMDkxMDIwMjIwNTQ2NTA=", "x": "y", "z": "r"}'
@Jiang Is there a way of doing it for an undefined amount of images?
j
It's not officially supported for the sake of for the sake of a clearer API.
Can you share an actual usage scenario where you need this feature? This could help to decide whether to include such a feature.
y
I have an api endpoint that I allow users upload multiple files and perform my model's predictions on all of the files to give them a "result" to all of the files they uploaded
j
your client upload multiple files through form-data?
y
Yes
j
Then you will generate a random key for each file?
y
I will return a json that includes the prediction from each file
j
with list?
Can you share more specific examples of the input and output of the API?
y
The input is a json and a list of files. The output is a json that holds the prediction of each image as a key-value json object
j
So the keys are the keys of the form data?
y
Actually I want to correct myself. I accept list of files as input and the output is a JSON that holds the predictions of all the images all together. Just a JSON output
j
Then how does the API user know which result represent which image?
y
The API user wants, needs, and gets the result for all images together and not for each image
s
This is a feature that we intend to implement, but don't have any concrete plans to immediately. Is this something that's blocking you? @Sean maybe we can consider doing this?
y
Yea I need it