Welcome Guest, Not a member yet? Register   Sign In
CURLRequest returns 403 error / shell_exec returns 200
#1

Environment: PHP: 7.4.9 — CodeIgniter: 4.0.4

Any ideas on this problem:

When I consume an API using the CURLRequest
PHP Code:
$curlClient = \Config\Services::curlrequest();
$response $curlClient->request'POST'$thePath, ['body' => "username=THEUSER&password=THEPASSWORD"'http_errors' => FALSE] ); 

I get a 403 error, however when I execute
PHP Code:
$response shell_exec'curl -d "username=THEUSER&password=THEPASSWORD" -X POST ' $thePath ); 

the api return 200 and the actual data.

A bit more context, the api call is to get a JWT from a Wordpress authorisation plugin.
Dirk B.
Abatrans Software
No SEO spam - see forum guidelines
Reply


Messages In This Thread
CURLRequest returns 403 error / shell_exec returns 200 - by abatrans - 11-15-2021, 12:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB