You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm trying to implement file upload in my application, using the Blob type.
Specifically, I have a request body object that contains some normal fields and one File field:
I want to use the generated http service in order to send this request, but I need to use FormData to send the file.
The RequestBuilder supports Blob types and can create a FormData object with all fields, but only via the rb.body method. But, the service does not expose a parameter to override the body's content type (which controls whether FormData is used or not - 'multipart/form-data'), and the default is 'application/json'.
Moreover, I'd like to override the value for reportProgress in the options object passed to rb.build, but again - not possible.
Any ideas is this is possible? Or how it can be done using the generated code?
Thank you!
The text was updated successfully, but these errors were encountered:
ophirKatz
changed the title
Allow to set values like contentType in RequestBuilder.body or options.reportProgress in RequestBuilder.build
FileUpload: Allow to set values like contentType in RequestBuilder.body or options.reportProgress in RequestBuilder.build
Jan 25, 2023
ophirKatz
changed the title
FileUpload: Allow to set values like contentType in RequestBuilder.body or options.reportProgress in RequestBuilder.build
File Upload: Allow to set values like contentType in RequestBuilder.body or options.reportProgress in RequestBuilder.build
Jan 25, 2023
Hi! I'm trying to implement file upload in my application, using the
Blob
type.Specifically, I have a request body object that contains some normal fields and one
File
field:I want to use the generated http service in order to send this request, but I need to use
FormData
to send the file.The
RequestBuilder
supportsBlob
types and can create aFormData
object with all fields, but only via therb.body
method. But, the service does not expose a parameter to override the body's content type (which controls whetherFormData
is used or not - 'multipart/form-data'), and the default is 'application/json'.Moreover, I'd like to override the value for
reportProgress
in the options object passed torb.build
, but again - not possible.Any ideas is this is possible? Or how it can be done using the generated code?
Thank you!
The text was updated successfully, but these errors were encountered: