11 use http\Message as HttpMessage;
14 echo new HttpMessage(" gosh\n nosh\n ");
15 } catch (Exception $ignore) {
18 $m = new HttpMessage();
22 $m->getType()==HttpMessage::TYPE_NONE,
26 $m = new HttpMessage("GET / HTTP/1.1\r\n");
30 $m->getType()==HttpMessage::TYPE_REQUEST,
31 $m->getRequestMethod(),
36 $m = new HttpMessage("HTTP/1.1 200 Okidoki\r\n");
40 $m->getType()==HttpMessage::TYPE_RESPONSE,
41 $m->getResponseCode(),
42 $m->getResponseStatus(),
46 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty.txt"));
50 $m->getType()==HttpMessage::TYPE_RESPONSE,
51 $m->getResponseCode(),
52 $m->getResponseStatus(),
55 echo $m->getParentMessage();
57 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_gzip.txt"));
61 $m->getType()==HttpMessage::TYPE_RESPONSE,
62 $m->getResponseCode(),
63 $m->getResponseStatus(),
66 echo $m->getParentMessage();
68 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_chunked.txt"));
72 $m->getType()==HttpMessage::TYPE_RESPONSE,
73 $m->getResponseCode(),
74 $m->getResponseStatus(),
77 echo $m->getParentMessage();
79 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_helloworld_chunked.txt"));
83 $m->getType()==HttpMessage::TYPE_RESPONSE,
84 $m->getResponseCode(),
85 $m->getResponseStatus(),
88 echo $m->getParentMessage();
112 Date: Wed, 25 Aug 2010 12:11:44 GMT
113 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
114 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
115 Etag: "2002a-0-48549d615a35c"
118 Vary: Accept-Encoding
120 Content-Type: text/plain
121 X-Original-Content-Length: 0
128 string(29) "Wed, 25 Aug 2010 12:11:44 GMT"
130 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
132 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
134 string(23) ""2002a-0-48549d615a35c""
140 string(15) "Accept-Encoding"
144 string(10) "text/plain"
145 ["X-Original-Content-Length"]=>
148 GET /default/empty.txt HTTP/1.1
153 Date: Thu, 26 Aug 2010 09:55:09 GMT
154 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
155 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
156 Etag: "2002a-0-48549d615a35c"
158 Vary: Accept-Encoding
161 Content-Type: text/plain
162 X-Original-Content-Length: 20
163 X-Original-Content-Encoding: gzip
170 string(29) "Thu, 26 Aug 2010 09:55:09 GMT"
172 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
174 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
176 string(23) ""2002a-0-48549d615a35c""
180 string(15) "Accept-Encoding"
186 string(10) "text/plain"
187 ["X-Original-Content-Length"]=>
189 ["X-Original-Content-Encoding"]=>
192 GET /default/empty.txt HTTP/1.1
194 Accept-Encoding: gzip
198 Date: Thu, 26 Aug 2010 11:41:02 GMT
199 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
200 X-Powered-By: PHP/5.3.3
201 Vary: Accept-Encoding
203 Content-Type: text/html
204 X-Original-Transfer-Encoding: chunked
212 string(29) "Thu, 26 Aug 2010 11:41:02 GMT"
214 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
216 string(9) "PHP/5.3.3"
218 string(15) "Accept-Encoding"
222 string(9) "text/html"
223 ["X-Original-Transfer-Encoding"]=>
228 GET /default/empty.php HTTP/1.1
233 Date: Thu, 26 Aug 2010 12:51:28 GMT
234 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
235 Vary: Accept-Encoding
237 Content-Type: text/plain
238 X-Original-Transfer-Encoding: chunked
248 string(29) "Thu, 26 Aug 2010 12:51:28 GMT"
250 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
252 string(15) "Accept-Encoding"
256 string(10) "text/plain"
257 ["X-Original-Transfer-Encoding"]=>
262 GET /cgi-bin/chunked.sh HTTP/1.1