troydavisson / PHRETS

PHP client library for interacting with a RETS server to pull real estate listings, photos and other data made available from an MLS system
http://troda.com
MIT License
451 stars 236 forks source link

401 authorization error #204

Open carenamaemanzano opened 6 years ago

carenamaemanzano commented 6 years ago

Hi @troydavisson ,

Your PHRETS is very awesome and helpful but got minor errors when trying to connect to https URL. I tested the url, password, username in retsmd and they are actually working per perfectly. But when I used it in PHRETS it gave me this error:

Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://bridge-rets.mlspin.com:12109/rets/login resulted in a 401 Unauthorized response:

I am hoping that you will reply on this. Thank you

cbbov-rf commented 6 years ago

I found that adding this line before creating your session fixed the issue for me.

\PHRETS\Http\Client::set(new \GuzzleHttp\Client); //-- Add this line $rets = new \PHRETS\Session($config);

kodie commented 5 years ago

I've also noticed that you can get a 401 Unauthorized error if you use the wrong Authentication Method.

$config->setHttpAuthenticationMethod('basic');
vita10gy commented 5 years ago

I've also noticed that you can get a 401 Unauthorized error if you use the wrong Authentication Method.

$config->setHttpAuthenticationMethod('basic');

There went an hour or 2. Thanks!