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

(This post was last modified: 05-17-2022, 08:35 AM by junosapien. Edit Reason: addintional info )

Thanks for the input. I've tried a number of different things (including Postman, which works), and think the issue is that CI4 is not receiving the Content-Type header from the C++ app (it is explicitly set with this:
Code:
CString strHeaders = _T("Content-Type: application/x-www-form-urlencoded");

Here is a simple print of the headers received by both CI4 and CI3 on the same server. (I have copied my old CI3 app to a directory called 'dev' inside the Public directory of CI4.)

Headers from CI3 in Public folder
host: test.site.com
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Authorization: Basic XXXXXXXXXXXXXXXXXXXX
Content-Type: application/x-www-form-urlencoded
Cookie: ci_session=9do54stine1po2c0tren49gr17eq068g
User-Agent: CustomName
X-Forwarded-For: 96.68.149.126
X-Forwarded-Port: 443
X-Forwarded-Proto: https
Content-Length: 164
Connection: keep-alive

Response from CI3
Subscription number: 9999999999999999
Activation: No
Error: Activation Key does not exist.


Headers from CI4
host: test.site.com
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Authorization: Basic XXXXXXXXXXXXXXXXXXXX
Cookie: ci_session=g6v3qlgms2bv3ijv19hpl3cgnvnbg4kk
User-Agent: CustomName
X-Forwarded-For: 96.68.149.126
X-Forwarded-Port: 443
X-Forwarded-Proto: https
Connection: keep-alive

Response from CI4
Subscription number:
Activation: No
Error: No parameters sent.

As you can see - the C++ app connects to the CI3 controller, with the Content-Type in the header and returns what I would expect given the parameters I passed in. However, CI4 is not receiving the Content-Type header and tells me that no parameters were passed.

Any thoughts as to why CI4 would be unable to recognize the Content-Type sent by the C++ app?
Reply


Messages In This Thread
RE: Capturing post data from C++ application in Codeigniter 4 - by junosapien - 05-16-2022, 05:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB