jenssegers / php-proxy

A PHP proxy script with https and post support
https://jenssegers.com
933 stars 266 forks source link

Cannot get response code for some occasions #49

Closed shalindasuresh closed 7 years ago

shalindasuresh commented 7 years ago

Is there any way to get status code before output the html as for response? I need to get status code before desplay html page.example I dont need to display unauthorized html page instead I need to filter response code and re-authorized.I tried with response->getStatusCode().this works when there is success response but not for any other http status code,Handling this kind of situation was easy with prior versions.

dasun4u commented 7 years ago

Use this For Guzzle 6 bro... ;) $client = new \GuzzleHttp\Client(['http_errors' => false]);

shalindasuresh commented 7 years ago

Thanks @dasun4u ,that's what I wanted (y)