-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat: Support MultipartRequest in functions invoke #977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! We probably need to export MultipartFile
so that it's available to the users, right?
It's from the http package, which I guess most people have already installed and can import themself. But exporting just that class won't hurt, so I will add that tomorrow. |
Awesome 👍 Just sharing my two cents, but I think it's common for people to not have the HTTP package installed if they are using Supabase. |
Since more types for the body are allowed now, I've added a basic content header detection. For string inputs, it sets the header to text/plain and for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the automatic content type detection!
What kind of change does this PR introduce?
feature
What is the current behavior?
The
body
can only be of typeMap<String,dynamic>
and no files can be uploaded.What is the new behavior?
The
body
can be anyObject
, which is encodable to String. There's now afiles
parameter to send files with aMultipartRequest
.Additional context
At the moment everything is bundled in one method like in functions-js. One could argue to create an extra method to be more type safe with
body
beingMap<String,String>
.close #933