Welcome Guest, Not a member yet? Register   Sign In
Can not use CURL in codeigniter 4
#1

It is not possible to use pure php curl request in ci4 without using the curl request class?
my curl response here work in ci3 buth is returning null here in ci4

PHP Code:
$ch curl_init('https://api.ravepay.co/flwv3-pug/getpaidx/api/v2/verify');                                                                      
            curl_setopt
($chCURLOPT_CUSTOMREQUEST"POST");
            curl_setopt($chCURLOPT_POSTFIELDS$data_string);                                              
            curl_setopt
($chCURLOPT_RETURNTRANSFERtrue);
            curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
            curl_setopt($chCURLOPT_HTTPHEADER, array('Content-Type: application/json'));
    
            $response 
curl_exec($ch);
    
            $header_size 
curl_getinfo($chCURLINFO_HEADER_SIZE);
            $header substr($response0$header_size);
            $body substr($response$header_size);
    
            curl_close
($ch);
    
            $resp 
json_decode($responsetrue); 

When try to var dump $resp it return empty and my payment gateway notify success in the payment dashbord.
Reply
#2

There is nothing in CI4 that should prohibit curl from working.
Reply
#3

Okay thank you
Reply




Theme © iAndrew 2016 - Forum software by © MyBB