Hi,
I'm new in PureBasic programming, and I have problem with using http command get. I'm trying in simple way to download a small file - logo of PB of this forum, and I dont recieve the information from server.
This is my code:
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right." "psssst! i steal signatures... don't tell anyone! "
dreamerman wrote:Ok,
thanks, it's working with these two methods.
That is a pity, that there is no multi-platform library for http downloading for PB... Maybe in the future... :roll:
The first method may work (chr(10)+chr(10)) but it's not guarunteed on all browsers and header parsers since some rely on the chr(13)s to parse the fields.
"Should", hmm, I don't see how it works properly for any of them, since it doesn't even support chunked transfer-encoding, which is one of the requirements of HTTP/1.1. And receiving data byte by byte(ReceiveLine()) is just generally _lame_ and should never be done.
btw. even thought you send "GET /File HTTP/1.0", your request will be handled as coming from HTTP/1.1 compliant client since you use "Host:" header which isn't supported by HTTP/1.0, and you can check this from response header...