A
A
Abc Edc2014-10-03 19:25:11
Computer networks
Abc Edc, 2014-10-03 19:25:11

Why does the windows phone application not see GetRespons?

I write under the computer everything is fine and everything works
here is a piece of code

string address = "http://kladr-api.ru/api.php?query=";
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
                request.Method = "GET";
                request.Timeout = 10000;
                request.Accept = "application/json";
                HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                var stream = new StreamReader(response.GetResponseStream());

and the same thing for windows phone emphasizes GetRespons, what's wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
follow39, 2014-10-03
@follow39

Because the phone has a different API.

A
aush, 2014-10-03
@aush

Under windows phone (initially, this was done under silverlight), there is no synchronous GetResponse, instead you should use asynchronous operations, for example, BeginGetResponse or GetResponseAsync.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question