php-http / message

HTTP Message related tools
http://php-http.org
MIT License
1.3k stars 42 forks source link

ResponseBuilder class. #30

Closed mekras closed 8 years ago

mekras commented 8 years ago

client-tools repo was removed, so I recreated PR for ResponseBuilder here.

Not sure about spec file because I'm not familiar with PhpSpec.

joelwurtz commented 8 years ago

Don't really understand the purpose of such builder ? Why not using a response factory or directly the response ?

mekras commented 8 years ago

@joelwurtz, we have response factory which can do this?

The purpose is reuse of implementation independent code. It was discussed in original PR. Parsing headers is a common task for HTTP client (similar code in socket and curl clients). Also it can be used by third-party libs. For example I need to create HttpMessage instances from HTTP dumps and so can use this functionality.

joelwurtz commented 8 years ago

Hum didn't read well the code, my bad ^^

LGTM :+1: