====== Debugging API requests ====== Debugging API requests is of course important to know whats going wrong when trying to develop or implement an API but theres many different ways to do it. ===== Testing ===== You can implement tests to call the API with fabricated data which makes it easy to reach the case you want to debug etc. This isn't thaat quick and easy though since it requires you to implement a whole test. Tests however are never bad to have so this is a decently good option. ===== Internal HTTP client ===== For some programs theres internal HTTP clients that can send requests through .http files and debug those. An example of this is PHPStorm ofc, those allow you to prepare and version HTTP requests to test certain endpoints, though you may still have to alter the data to obtain a state that works for the case you're trying to debug. ===== Postman ===== Debugging through Postman is a bit different, it acts similar to a browser where you set a cookie for XDebug in my case and XDebug recognises that and if you have your debugger set up correctly it will now alow you to debug the necessary code over a Postman request. ===== Browser ===== You could technically also debug an API request by constructing it over a browser but its not very intuitive or easy so I do not reccomend. ===== CLI ===== You could technically also debug an API request with something like curl and construct it in there but that also seems icky so I don't reccomend.