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
#2

It may be the bug.
https://codeigniter4.github.io/CodeIgnit...der-change

Upgrade 4.1.5.
And see https://codeigniter4.github.io/CodeIgnit...urlrequest
Reply




Theme © iAndrew 2016 - Forum software by © MyBB