Keyur Mehta

Keyur Mehta

  • 1.8k
  • 17
  • 170

WEB API - File upload with json data

Sep 2 2019 5:21 AM
Hello to all,
 
I am trying to make a web API in c# for sending an email. My API is ready to send an email with the body part. Now I am trying to implement attachment. I have to upload attachment files to the server and I studied many documents to upload file on the server. I also got the success to upload files with MultiPart Async. But can anyone suggest me that how can I handle the upload files and also send the JSON data in a single request? Means when I call the API to send the email I have to send the data like, From email address, to address, body part. And also I want to upload the attachment file in the same request. 
 
I appreciate the suggestion.  
 
Thank You. 

Answers (4)