Skip to content
Advertisement

Php rest service not returning correct responses

I’ve recently wanted to use a library, that is only available in Php (austinb/gameq)

As I really dont know much about Php, to be able to use it with my other webservices (.Net core), I’ve decided that best way would be to just host it as its own Rest service.

I’ve tried using marcj/php-rest-service but to no avail, all responses I get are 200(Ok), even when an endpoint is not correct. No errors in both browser and local consoles.

I use php -S localhost:8888 index.php to start it. Am I missing something?

index.php

JavaScript

restGameQ.php

JavaScript

P.S. I’ve really wanted to use peachpiecompiler/peachpie but they dont support yet stream_select that is required by the lib.

Advertisement

Answer

After some research, I found that marcj/php-rest-service is an old repo, with many problems in newer PHP versions.

ElementaryFramework/WaterPipe is a great, still supported and robust framework for your HTTP needs.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement