-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept-Encoding as Request Header #4
Comments
I'd be very interested in this, MLSGrid is only communicating on a compressed stream starting on Aug 14th. |
same! working with MLS Grid which requires compressed gzip. |
can anyone verify that #5 works? |
I forked this project for several reasons, this issue being one of them. I would be more than happy to push a PR. |
I can verify that the modifications do in fact work for MLSGrid requests. The only other modification I had to do was to gzdecode() the returned data since for some reason that piece was not automatic. |
The simplest solution is to update the curl options to set
This is the only change required for it to work correctly with MLSGrid (and any others, I'd guess), and it does not cause any problems with our other RESO providers: diff --git a/lib/HttpClient/CurlClient.php b/lib/HttpClient/CurlClient.php
index f27f4c98f..53da6c1bf 100644
--- a/lib/HttpClient/CurlClient.php
+++ b/lib/HttpClient/CurlClient.php
@@ -173,6 +173,7 @@ public function request($method, $absUrl, $headers, $params, $hasFile)
$opts[CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout;
$opts[CURLOPT_TIMEOUT] = $this->timeout;
$opts[CURLOPT_HEADERFUNCTION] = $headerCallback;
+ $opts[CURLOPT_ACCEPT_ENCODING] = '';
if($headers) {
$opts[CURLOPT_HTTPHEADER] = $headers;
} From the curl docs:
|
Accept-Encoding as Request Header
This library is sending only Accept and Authentication params as Header of the Request::request(). Some API providers like MLSGrid need to send more params (like Accept-Encoding) as a Header.
The text was updated successfully, but these errors were encountered: