Closed devexsolutions closed 3 years ago
I’m assuming you’re using the latest GitHub main/master code against the latest beta of core?
there are changes in core that need to be tracked in - specifically related to getrestmodel. I’m on my phone so can’t find it to link to.
Beyond that you are using a GET request when it should be POST. You should be passing form data not url parameters.
Yes, I am using the latest code uploaded to the repository of both TI and TI-EXT-API project. At what point am I using a GET request instead of a POST request? According to the documentation POST api / customers, is used to create a customer. Thanks
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://localhost/bares/api/customers',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer 1|nyCzahZn3qz6ezG3W4y88Y0LIheypzy12JDefhvO3hkgGBlyLUnqSL6FYsT8ZeDsXgHD9HU0iMSDMJV1'
),
CURLOPT_POSTFIELDS => json_encode([
'first_name' => 'x',
'last_name' => 'y',
]),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;**
Think you also are missing that commit: https://github.com/tastyigniter/TastyIgniter/commit/a4392380366e0529696f0ac03931e7a6a3dece4b
Now yes friend, added the changes to FromRequest.php and it works fine. Thanks.
Expected behavior:
Actual behavior:
Reproduce steps: I am trying to create a client from the API, following the extension documentation. But I get an error when I make the call to the EndPoint. First I get a new Token and then what I do is add the parameters as seen in the attached code (Curl). For testing, I am using PostMan
` **$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'http://localhost/bares/api/customers?first_name=Jon&last_name=Doe&email=ja_camseg@hotmail.com&telephone=1234512345', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array( 'Authorization: Bearer 1|nyCzahZn3qz6ezG3W4y88Y0LIheypzy12JDefhvO3hkgGBlyLUnqSL6FYsT8ZeDsXgHD9HU0iMSDMJV1' ), ));
$response = curl_exec($curl);
curl_close($curl); echo $response;**`
Version: 3.0.4 beta 27
Additional Information: (Additional information, if any)