c# - Upload a File from HTML form using PostAsync -
i want upload file server using webapi. want call webapi in mvc homecontroller. when use webapi directly uploads files when want call webapi within controller using postasync, not send file api reason. this action in mvc controller: public async task<actionresult> upload(httppostedfilebase upload) { viewbag.title = "upload files"; if (upload != null && upload.contentlength > 0) { var client = new httpclient(); string fullurl = request.url.scheme + system.uri.schemedelimiter + request.url.host + ":" + request.url.port + "/api/values"; stringcontent httpcontent = new stringcontent(upload.filename); var response = await client.postasync(fullurl, httpcontent); var result = await response.content.readasasync<httpresponsemessage>(); } return view(); } this .cshtml file: <form name="form1" method=...