Home > Software engineering >  Testing if a POST api endpoint is working with PHP
Testing if a POST api endpoint is working with PHP

Time:05-19

I have a ticketing system and I just enabled an API endpoint that points to a custom PHP file I created. Everytime I update a ticket it sends the data to this endpoint saying its updated. How do I test if it actually is sending any data? Supposedly its doing a POST to that php file. I was thinking of sending this POST data to a a plain text file in the same folder to test.

But is there a better way to do this to test what that end point is sending?

CodePudding user response:

Did you try checking the network tab in chrome dev tools. There you can look up under "doc" or "XHR" which post headers have been sent.

CodePudding user response:

You need to log your inputs, outputs, or anything you want. There is a good log library you can use that name is Monolog but you can use the buffer or write in output using var_dump or write directly in a log file.

Also, you can use the XDebug to debug your codes

  • Related