![]() |
No, no. Your code is wrong.
You must pass three parameters, but you passed four parameters. PHP Code: $client->request('GET', '/get', ['query' => ['foo' => 'bar']]); Quote:By default, CURLRequest will throw HTTPException if the HTTP code returned is greater than or equal to 400. If you want to get the response, see the http_errors option.
(01-16-2024, 12:59 AM)kenjis Wrote: No, no. Your code is wrong. the request requires two parameters start date and end date , i try this : Code: public function getTransazionidispenser() whith same 500 error , than i don't understand how can i get curl error , with try catch ? if else?
If you want to see the response, not HTTPException,
see https://codeigniter4.github.io/CodeIgnit...ttp-errors
You passed 5 paramters to request() method, but you must pass 3 parameters.
The third parameter is an array. PHP Code: $response = $client->request('GET', $uri ,
(01-16-2024, 01:27 AM)kenjis Wrote: You passed 5 paramters to request() method, but you must pass 3 parameters. Passing array : Code: public function getTransazionidispenser() Same error
Why don't you send 'auth'?
I think you cannot access the API without auth credentials.
(01-16-2024, 01:51 AM)kenjis Wrote: Why don't you send 'auth'? send auth : Code: public function getTransazionidispenser() now work !!! Thank you so much !!!
Good!
If you want to get an error response, add 'http_errors' => false in the array. https://codeigniter4.github.io/CodeIgnit...ttp-errors |
Welcome Guest, Not a member yet? Register Sign In |