Skip to content
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

403 Forbidden Help Me ! #2208

Closed
rapcrown opened this issue Nov 17, 2018 · 5 comments
Closed

403 Forbidden Help Me ! #2208

rapcrown opened this issue Nov 17, 2018 · 5 comments

Comments

@rapcrown
Copy link

rapcrown commented Nov 17, 2018

Plase help me php 7.0 client error log.

`
use GuzzleHttp\Client;
use Tuna\CloudflareMiddleware;
use GuzzleHttp\Cookie\FileCookieJar;

$client = new Client(['cookies' => new FileCookieJar('testt.txt')]);

$test = $client->getConfig('handler')->push(CloudflareMiddleware::create());

$res = $client->request('GET', 'https://www.koreanturk.com/');
echo $res->getBody();

`

[17-Nov-2018 10:30:56 Europe/Istanbul] PHP Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://www.koreanturk.com/` resulted in a 403 Forbidden response:
in /home/botmerkezi/public_html/ff/guzzle-master/src/Exception/RequestException.php:113
Stack trace:
#0 /home/botmerkezi/public_html/ff/guzzle-master/src/Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/botmerkezi/public_html/ff/guzzle-master/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/botmerkezi/public_html/ff/guzzle-master/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /home/botmerkezi/public_html/ff/guzzle-master/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHt in /home/botmerkezi/public_html/ff/guzzle-master/src/Exception/RequestException.php on line 113
`

@alexeyshockov
Copy link
Collaborator

You receive 403 Forbidden response, that's clear from the exception. Please, specify the expected results, otherwise it's not possible to help you.

@Nyholm
Copy link
Member

Nyholm commented Dec 11, 2018

Please ask on Stackoverflow or similar. This is not related to Guzzle.

@Nyholm Nyholm closed this as completed Dec 11, 2018
@minhhieu08
Copy link

But when i call it in postman, it return excatly result i expected. So what is wrong here?

@placha
Copy link

placha commented Jun 9, 2020

@minhhieu08 Try with different 'User-Agent', maybe your server has some filters.

@FabianKoestring
Copy link

I had the same Problem. Accept Header for the rescue ... 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants