Konvertering fra C# til VB .net
HejFølgende C# kode sender data korrekt:
Dim request As HttpWebRequest
Dim URL As String = "http://blabla.kundeside.dk/json?key=t6%$SVAK7"
request = DirectCast(WebRequest.Create(URL), HttpWebRequest)
request.Method = "POST"
request.ContentType = "application/x-www-form-urlencoded"
Using Writer As New StreamWriter(request.GetRequestStream())
Writer.Write("new_username=" & new_username & "new_email=" & new_email & "new_password=" & new_password)
End Using
Jeg har forsøgt at oversætte til VB .net:
Dim request As HttpWebRequest
Dim URL As String = "http://blabla.kundeside.dk/json?key=t6%$SVAK7"
request = DirectCast(WebRequest.Create(URL), HttpWebRequest)
request.Method = "POST"
request.ContentType = "application/x-www-form-urlencoded"
Using Writer As New StreamWriter(request.GetRequestStream())
Writer.Write("new_username" = "Steen&new_email=ssa@phv.dk&new_password=123456")
End Using
...men i VB .net situationen får jeg ikke sendt data korrekt. Der opstår dog ingen fejl :-/