Well, http_result returns a string.
I guess it simply stops after reading 0x00, you can simply use base64 encoding and your problem is solved.