Sub Test
Dim filename As String = "https://b4x-4c17.kxcdn.com/android/forum/data/avatars/m/86/86664.jpg?1520274433"
Dim j As HttpJob
j.Initialize("", Me)
j.head(filename)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(GetCaseInsensitiveHeaderValue(j, "Content-Length", -1)) 'Response.ContentLength will not work with head requests
Else
Log(j.ErrorMessage)
End If
j.Release
End Sub
Private Sub GetCaseInsensitiveHeaderValue (job As HttpJob, Key As String, DefaultValue As String) As String
Dim headers As Map = job.Response.GetHeaders
For Each k As String In headers.Keys
If K.EqualsIgnoreCase(Key) Then
Return headers.Get(k).As(String).Replace("[", "").Replace("]", "").Trim
End If
Next
Return DefaultValue
End Sub