How to send and return images of a Web Api
from Controller
of a Asp.net MVC
application?
In my Controller
of project Asp.net MVC
I get from View
an image of type HttpPostedFileBase
and need to send to Web Api
using PostAsJsonAsync
. Ex.:
var response = await client.PostAsJsonAsync("api/image", image);
Note: I need to save in the database only the path of the image and its name, the file should be saved to a folder on the server.
Thank you.