Welcome Guest, Not a member yet? Register   Sign In
CURL problem
#1

Hello!

I ger null CSP with CURL request

Curl standart code (work good for me):

PHP Code:
                $ch curl_init();
        
curl_setopt($chCURLOPT_URL'http://127.0.0.1:8545');
        
curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
curl_setopt($chCURLOPT_POST1);
        
curl_setopt($chCURLOPT_HTTPHEADER, array(
            
'Content-Type: application/json'
        
));
        
curl_setopt($chCURLOPT_POSTFIELDSjson_encode($payload));
        
$result curl_exec($ch);
        
curl_close($ch); 

Equivalent CI:

PHP Code:
$result $client->request('POST''http://127.0.0.1:8545/', [
            
'data' => json_encode($payload),
            
'headers' => [
                
'User-Agent' => 'curl/1.0',
                
'Content-Type' => 'application/json',
            ],
        ]); 

1 method work good.
CI method response:

Code:
"CSP": null

How do I go next? any ideas
Reply


Messages In This Thread
CURL problem - by mintwint - 02-22-2020, 07:18 AM
RE: CURL problem - by dave friend - 02-22-2020, 09:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB