Choose payload.output Based on Content Type
I have a single endpoint that accepts both multipart/form-data and application/x-www-form-urlencoded.
If I receive multipart I would like to use:
payload: {
output: 'file',
parse: true
}
However, if I receive urlencoded I would like to use:
payload: {
output: 'data',
parse: true
}
This is not possible currently. Would there be a suggested alternative or is this something that would be desireable to include in the project?
How did you get yourself into this situation? :-) Why aren't these two different endpoints? Or why aren't they always multipart?
We have an API endpoint that accepts either a file upload or a link to a file for a parameter. As a convenience to users we accept both multipart as well as encoded.
How is that a convenience? It would be as easy for them to call two separate endpoints, and would be cleaner for a web form as well. Anyway, there is not current way to do this. I am inclined not to support it because I think the use case is a result of poor API design.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.