lino-framework / eidreader

eidreader Python script
http://eidreader.lino-framework.org/
GNU Affero General Public License v3.0
15 stars 6 forks source link

GET to server instead of POST #7

Closed tim-creso closed 3 years ago

tim-creso commented 3 years ago

I've followed the steps: https://eidreader.lino-framework.org/install.html#install-eidreader-on-windows

The eidreader files are in c:\eidreader The registry setting form beid:// was set The eid middleware is installed I've created a simple html page which contains the url "beid://https://somewebserver/eid" Following the link the browser asked to run the application eidreader.exe (I choose open always ...) The logfile was written correctly: [2021-08-20 08:20:42,780] INFO Invoked as C:\eidreader\eidreader.exe -l C:\eidreader\eidreader.log beid://https://somewebserver/eid [2021-08-20 08:20:42,780] INFO getproxies() returned {} [2021-08-20 08:20:42,780] INFO Load config from ['eidreader.ini' ... ] [2021-08-20 08:20:42,780] INFO Using proxies: {} [2021-08-20 08:20:42,780] INFO Reading data... [2021-08-20 08:20:45,977] INFO Got data {'card_data': '{"eidreader_version": "1.0.6", ... } [2021-08-20 08:20:45,977] INFO POST data to https://somewebserver/eid [2021-08-20 08:20:46,147] INFO POST returned <Response [200]>

So far so good. However, I could not detect any posted data.

So I've checked the request_method. It's GET instead of POST Adding this to my php file if( 'POST' != $_SERVER['REQUEST_METHOD'] ) { //Send a 500 status code using PHP's header function header($_SERVER["SERVER_PROTOCOL"] . ' 500 Internal Server Error', true, 500); exit; } Resulted in "[2021-08-20 09:11:20,732] INFO POST returned <Response [500]>"

How can I trigger the POST instead of GET method? How can I capture the card data in my webpage?

tim-creso commented 3 years ago

The problem is solved.

There was an issue with the SSL certificate and https redirection. The POST request was redirected and converted into a GET method.

Thanks to Joren and Kristof for this suggestion.