Welcome Guest, Not a member yet? Register   Sign In
Consume API externally
#5

(This post was last modified: 10-05-2021, 04:55 PM by RRIOS.)

(10-05-2021, 02:54 PM)includebeer Wrote: Double check your routes, your client app, your .htaccess file, your log files.. You must have something wrong with your routes config or your app doesn't call the right URL with the right HTTP method (POST/GET). Because this is a very simple thing and you must have overlook something.
Thanks for answering

Code:
$routes->get('/', 'Cliente::index');
$routes->post('vercli/show/(:num)','VerCli::show/$1');

Local Apache Access.log ( acess from app in smartphone )

192.168.0.4 - - [05/Oct/2021:17:48:32 -0300] "POST /CI4/public/vercli/show/ HTTP/1.1" 301 250 "-" "Dalvik/2.1.0 (Linux; U; Android 10; moto g(7) play Build/QPYS30.52-22-14)"

192.168.0.4 - - [05/Oct/2021:17:48:33 -0300] "GET /CI4/public/vercli/show HTTP/1.1" 404 114 "-" "Dalvik/2.1.0 (Linux; U; Android 10; moto g(7) play Build/QPYS30.52-22-14)"

Vercli.php Controller
<?php namespace App\Controllers;
 
use CodeIgniter\RESTful\ResourceController;
use CodeIgniter\API\ResponseTrait;
use App\Models\ClienteModel;
 
class VerCli extends ResourceController
{
    use ResponseTrait;

Sorry I couldn't format PHP code separate from the Access Log and separate from the controller PHP code in the forum editor.

THANK YOU, apparently it was app client side issue. 20:55 pm
Reply


Messages In This Thread
Consume API externally - by RRIOS - 09-28-2021, 05:51 AM
RE: Consume API externally - by includebeer - 10-04-2021, 04:23 PM
RE: Consume API externally - by RRIOS - 10-05-2021, 01:34 PM
RE: Consume API externally - by includebeer - 10-05-2021, 02:54 PM
RE: Consume API externally - by RRIOS - 10-05-2021, 04:28 PM
RE: Consume API externally - by includebeer - 10-05-2021, 05:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB