Please help me - I can't figure out how to use the new feature to get the http headers.
Here's my example:
Code: Select all
EnableExplicit
Define sUrl.s="https://www.purebasic.com/download/PureBasic_Demo.zip"
Define iConn.i
Define iProgress.i
InitNetwork()
iConn=ReceiveHTTPMemory(sUrl, #PB_HTTP_Asynchronous)
If Not iConn
Debug "Error"
End
EndIf
Debug "Headers >"+HTTPInfo(iConn, #PB_HTTP_Headers)+"<"
Repeat
iProgress = HTTPProgress(iConn)
Select iProgress
Case #PB_HTTP_Success
Debug "iConn finished (size: )"
End
Case #PB_HTTP_Failed
Debug "iConn failed"
FinishHTTP(iConn)
End
Case #PB_HTTP_Aborted
Debug "iConn aborted"
FinishHTTP(iConn)
End
Default
Debug "Headers >"+HTTPInfo(iConn, #PB_HTTP_Headers)+"<"
Debug "Current iConn: " + iProgress
EndSelect
Delay(500) ; Don't stole the whole CPU
ForEver
Where's my error?
Thanks for help
