c# - .NET EF HttpRequestException Error while copying content to a stream, using awaits -


i have following code throws exception on last line. i'm using visual studio 2015, ef .net mvc. method async task<actionresult> , not use "using" blocks.

i've been rattling head answers, have solution ?

var data = new dictionary<string, object> {     {"accountid", directdebit.account.id},     {"ddinfoid", directdebit.id},     {"instructiontype", type} };  httpclient.defaultrequestheaders.clear(); var uri = new uri(_apibaseurl + "/correspondence/generatedirectdebitcorrespondence"); var authtoken = await _apicommunicator.gettoken(); httpclient.defaultrequestheaders.tryaddwithoutvalidation("authorization", authtoken);  var response = await httpclient.postasjsonasync(uri, data); 

update: more information, api call is

file = new file {     createdbyuserid = _context.aspnetusers.singleordefault(u => u.username == "system").id,     createddatetime = datetime.utcnow }  return file 


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -