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?
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 oneFile
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. TheRequestBuilder
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 forreportProgress
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!