I'm trying to find out the content length of a file before downloading it, by doing a HEAD request:
However, I'm getting a Bad Request response from the server. I'm not sure about the order in my code, is it first HEAD followed by INITIALIZEHEAD, or is it the other way around? Why isn't this working? A standard GET request works but downloads the entire file.
B4X:
Dim httpjob As HttpJob
httpjob.Initialize("httpreturnfunction", Me)
httpjob.GetRequest.Timeout = 5000
httpjob.head(filename)
httpjob.GetRequest.InitializeHead(filename)
However, I'm getting a Bad Request response from the server. I'm not sure about the order in my code, is it first HEAD followed by INITIALIZEHEAD, or is it the other way around? Why isn't this working? A standard GET request works but downloads the entire file.