How can I get the http headers without downloading the content?
Thanks
http Headers without content?
http Headers without content?
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
Re: http Headers without content?
On phone, you can use the header only flag with a get see doc
https://www.purebasic.com/documentation ... emory.html
edit: Glad I checked as I had a bug, I was returning 100 continue
https://www.purebasic.com/documentation ... emory.html
edit: Glad I checked as I had a bug, I was returning 100 continue
Code: Select all
HttpRequest = HTTPRequestMemory(#PB_HTTP_Get, "https://atomicwebserver.com/index.html",0,0,#PB_HTTP_HeadersOnly)
If HttpRequest
Debug "StatusCode: " + HTTPInfo(HTTPRequest, #PB_HTTP_StatusCode)
Debug "headers: " + HTTPInfo(HTTPRequest,#PB_HTTP_Headers)
FinishHTTP(HTTPRequest)
Else
Debug "Request creation failed"
EndIf
Re: http Headers without content?
You're talking about headers but I liked the signaturevwidmer wrote: Mon Oct 21, 2024 1:35 am I just put stuff here and there and sometimes like magic it works.

Re: http Headers without content?
@idle: Thank you very much!! Not sure how I missed that but it is working as need.
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
Re: http Headers without content?
Magic gets better with practice

WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
Re: http Headers without content?
Thank you for not noticing as I was able to fix a bug in my code.vwidmer wrote: Tue Oct 22, 2024 12:34 am @idle: Thank you very much!! Not sure how I missed that but it is working as need.
