Welcome Guest, Not a member yet? Register   Sign In
curlrequest - help
#3

I'm not defining the base_uri but passing the full URL. Below is the updated code.

$keys->url = "https://dommain.com"
$client = single_service('curlrequest');
$result = $client->post($keys->url.'/v2/', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'JWT '.$access->token,
'x-api-key' => $keys->key
],
'body' => $payload,
'debug' => true
]);

I tried the below method and it worked.
$client->setBody($payload)->post($keys->url.'/v2/',...................

Looks like we can't pass the body payload in the option array.
Reply


Messages In This Thread
curlrequest - help - by chakycool - 08-15-2021, 11:44 AM
RE: curlrequest - help - by InsiteFX - 08-17-2021, 01:10 AM
RE: curlrequest - help - by chakycool - 08-19-2021, 02:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB