Urlconnection failed to receive web server 302 found?
httpsocket is ok.
[code]Dim jRoot As New JSONItem
Dim jTemp As New JSONItem
Dim strReply As String
jTemp.Value(“DeviceID”) = “31011506002190000101”
jTemp.Value(“ProtocolVersion”) = “2.0”
jRoot.Value(“RegisterObject”) = jTemp
Print “use URLConnection”
Dim myHttp As New URLConnection
myHttp.AllowCertificateValidation=False
myHttp.RequestHeader(“User-Identify”) = “31011506002190000101”
myHttp.SetRequestContent(jRoot.ToString , “application/VIID+JSON; charset=UTF-8”)
myHttp.RequestHeader(“User-Agent”) = “agbox”
Try
strReply=myHttp.SendSync(“GET”, “http://localhost:12000/VIID/System/Register”,1)
Catch
End Try
Print strReply
Print myhttp.HTTPStatusCode.ToText
Print “use HTTPSocket”
Dim http As New HTTPSocket
http.SetRequestHeader(“User-Identify”,“31011506002190000101”)
Http.SetRequestContent(jRoot.ToString , “application/VIID+JSON; charset=UTF-8”)
strReply=http.SendRequest(“POST”, “http://localhost:12000/VIID/System/Register”, 1)
Print strReply
Print http.HTTPStatusCode.ToText[/code]
return
[code]use URLConnection
0
use HTTPSocket
Found
302
[/code]