Welcome Guest, Not a member yet? Register   Sign In
Capturing post data from C++ application in Codeigniter 4
#1

I am upgrading our site from Codeigniter 3 to Codeigniter 4. So far it has been tedious, but mostly gone well. I am running into an issue now with a controller that will not recognize posted values from an app written in C++. This app has been working with CI 3 for many years now, but... well, CI4. I don't know all the details about the C++ app, but the developer assures me he is definitely using HTTP_VERB_POST to send the data to the controller.

I have created a view for the controller and CAN successfully Post values from a form using my browser.

However - Posting from the app 1) tells me the request method is GET and 2) NO values at all have been passed. It DOES however - send me the response I would expect if no values are passed to the controller......

After adding the following to my controller:
PHP Code:
header('Access-Control-Allow-Origin: *');
        echo 
$this->request->getMethod();
        echo 
"\n POST VARS = ";
        
print_r($_POST);
        echo 
"\n GET VARS = ";
        
print_r($_GET);
        echo 
"\n"

I get the following result:
Code:
get
POST VARS = Array
(
)

GET VARS = Array
(
)

Activation: No
Error: No parameters sent.

The last two lines (Activation and Error) are what I would expect to get from this controller if, indeed, no parameters are sent.

Oh - and no, I do not have CSRF (except for default Cookie based CSRF Protection) enabled in my CI 4 application.

Any ideas would be greatly appreciated!
Reply


Messages In This Thread
Capturing post data from C++ application in Codeigniter 4 - by junosapien - 05-10-2022, 07:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB