web server 302 found

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]

302 means that the item you are looking for is known but is located elsewhere. The “where” you received in the header “Location”.
You can try again pointing there.

302, 303 and 307 are different ways of “follow the new location”.

HttpSocket can get httpstatuscode = 301 correctly, but urlconnection returns timeout error.

Does urlconnection automatically handle 301 status?