I am new to both C# and Windows phone and am trying to make a small app that performs a JSON request. I am following the example in this post https://stackoverflow.com/a/498
HttpWebRequest doesn't have a GetRequestStream or GetRequestStreamAsync in WP8. Your best bet is to create a Task and await on it, like so:
using (var stream = await Task.Factory.FromAsync(request.BeginGetRequestStream, request.EndGetRequestStream, null))
{
// ...
}
Edit: as you've mentioned that you're new to C#, you would need to have your login method be async to use the await keyword:
public async Task LoginAsync()
{
// ...
}
Callers to login would need to use the await keyword when calling:
string result = await foo.LoginAsync();
Here's a good primer on the subject: http://msdn.microsoft.com/en-us/library/vstudio/hh191443.aspx