Here
https://www.b4x.com/android/forum/threads/getting-http-headers-only.94536/post-598223
ContentLength turns out to be zero.
And I also tried to request the ContentLength of different JPG files on different sites in the same way. ContentLength always turns out to be zero for some reason. Is this how it should be?
Maybe the problem is that sites prohibit downloading headers separately from the content?
B4J
https://www.b4x.com/android/forum/threads/getting-http-headers-only.94536/post-598223
ContentLength turns out to be zero.
And I also tried to request the ContentLength of different JPG files on different sites in the same way. ContentLength always turns out to be zero for some reason. Is this how it should be?
Maybe the problem is that sites prohibit downloading headers separately from the content?
B4X:
Private Sub Button1_Click
Test
End Sub
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("ContentLength = " & j.Response.ContentLength)
Else
Log(j.ErrorMessage)
End If
j.Release
End Sub
B4J
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
ContentLength = 0
B4A
Copying updated assets files (1)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
** Activity (main) Pause event (activity is not paused). **
** Activity (main) Resume **
*** Receiver (httputils2service) Receive (first time) ***
ContentLength = 0
Attachments
Last edited: