I'm trying to use an Autorest generated C# client to send MultipartFormDataContent but the request always fails as it seems that the RequestContent in Azure.Core does not seem to support naïve usage.
For example, I'd like to do something like this:
RequestContext myRequestContext = new RequestContext();
MultipartFormDataContent formData = myObject.ToMultipartFormDataContent();
RequestContent content = RequestContent.Create(formData);
myAutorestClient.MyEndpointPost(content, myRequestContext);
However, it seems as if the RequestContent.Create call fails to properly convert the MultipartFormDataContent.
Is there any guidance on how to properly send Multipart form data using the Azure.Core RequestContent object?
Try to use ConvertMultipartFormDataContent method to implement it.
The usage should be like below: