I got some images to download using HTTP. I got these images’ URL, how to build the TCP-based HTTP buffer to download the image?
I got no library in my current platform, the only supported language in this platform is C, so I have to build the HTTP buffer for these resources.
Currently I have build the normal API request, they are all HTTP request, every request have 0 or more parameters. But the image request got only a URL, such as http://some-image.jpg, it seems just a download job, no API parameters, no authorization, it’s simple, but how to construct the TCP request?
According to the http://www.jmarshall.com/easy/http/#sample, I build my TCP request like that:
On my
recv_callback, I got the server response like that:I downloaded the image from Chrome, and it’s size is the same as
Content-Length: 42299, I think I got the image buffer.