Mashape/unirest-php — pull request #17 by larrykluger (2013-08-08 18:02:54+00:00)
Title: Added Debug tracing and response->raw_headers

Hi,

I added two features, thank you for considering them for integration.

More info below.

Regards,
Larry Kluger

### Debug Tracing

When working with a new protocol, sometimes you need to see exactly what is being sent and received "on the wire." This type of "peeking" is a common development tool for network protocols. Debug trace is enabled when he calling program defines a constant `UNIREST_TRACE`. See the bottom of the updated Readme.

### response->raw_headers

As I developed my app, which is implementing OAuth with SharePoint Online, I found that the existing `response->headers` was not sufficient since Microsoft returns two headers with the same key (the same name). Since response->headers is a hash, the second instance of the header was overwriting the first one. There was no way for me to access the first value of the header. So I added the `raw_headers` property.

It turns out that having multiple headers with the same name is legal. See the HTTP specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 But is certainly unusual. I think adding `raw_headers` is a light-weight way to enable people to deal with this corner-case.