I am doing some API requests using fsockopen() in PHP. For most APIs that works correctly, but from http://geocoding.cloudmade.com/ I get the following (RAW) response:
HTTP/1.1 200 OK
Server: nginx/0.6.35
cache-control: no-cache
Content-Type: application/json; charset=utf-8
Date: Tue, 19 Feb 2013 11:08:05 GMT
pragma: no-cache
Transfer-Encoding: chunked
Connection: close
2fb
{"found": 1, "bounds": [[52.48732, 13.42553], ...
0
My problem is that "2fb" in the first line and the "0" in the last line of the body does not tell my anything. If I send the same request via Firefox, the body does not contain a "2fb" or "0". Therefore, I guess it has some meaning. But what?
Thanks for hints!
That is chunked transfer-coding, also indicated by the
Transfer-Encoding: chunked
response header:2fb
, followed by\r\n
, indicates the size of the following chunk (763 bytes). A chunk-size of0
indicates the last chunk.