Maybe copied not whole script. Some code is hidden between the visible first and second lines. Click the Copy link.
When in the second code you have r:
Or in the first code replace the last code line:
Not tested.
When in the second code you have r:
C# code:
var jsonstr = r.Content.ReadAsStringAsync().Result;
Or in the first code replace the last code line:
C# code:
var jsonstr = client.UploadString("http://192.168.1.1/test/", data);
Not tested.