Get json data from a htttp based web service C# -
i can't recieve json data http web service, because of data size - guess - 7 mb, first tried :
private async task<string> getresponse(string url) { httpresponsemessage response = null; httpclient client = new httpclient(); try { response = await client.getasync(url); } catch (exception ) { throw; } return await response.content.readasstringasync(); }
but gives me "task canceled exception", after doing search , found might request timeout limit probleme, implemented second solution setting timeout limit 2 minutes :
httpclient client = new httpclient(); client.timeout = new timespan(0, 2, 0);
when executing, there no result, no exception , app blocks @ method
client.getasync(url);
Comments
Post a Comment