docaholic
docaholic

Reputation: 625

C# webrequest problems

i'm having a bit of an issue when trying to create a WebRequest for Windows Phone 7.

When I try following the code examples from MSDN, it keeps saying to do this:

Stream data = response.GetRequesteStream;

But when i type that into Visual Studio 2010 Express for Windows Phone, I get a red squiggly line and an error message stating:

System.Net.WebRequest does not contain a reference for "GetRequestStream" 
and no extention method "GetRequestStream" accepting a first argument of 
type 'System.Net.WebRequest' could be found

Any ideas as to what's going on? It seems as though I'm missing an actual method...but I don't know why.

Upvotes: 1

Views: 305

Answers (1)

ctacke
ctacke

Reputation: 67198

Windows Phone doesn't support many (most) synchronous APIs. You must use the asynchronous BeginGetRequestStream method.

There are probably plenty more online, but one example of usage for the Phone can be found here.

Upvotes: 2

Related Questions