How to trigger xDebug when working from REST Client?
Because I couldn't make this to work properly then I came with a different approach at least for the API calls that happen through cURL. phpStorm now includes a REST Client which is awesome so I am using it to test my API endpoints. See below a working example:

The request is successful and it worked like a charm. However I would like to debug my code using xDebug. I am taking the idea of add a cookie borrowed from the browser configuration where defining such cookie makes the debugger to work. So I have added the following to my request:

But the debugger is never started. Notice how I have added the same var to the Header as well - just in case. The debugger is listening and it's setup properly. Any ideas in how to achieve this?
I must said I switch to phpStorm REST built in client after several tries using Postman and Inmsonia clients.
请先登录再写评论。
Hi there,
1) REST Client is deprecated (as the message on screenshot says). Now it's editor-based client -- https://blog.jetbrains.com/phpstorm/2017/09/editor-based-rest-client/ and https://blog.jetbrains.com/phpstorm/2018/04/easier-start-with-the-http-client/
2) If you want to debug using old REST Client -- why not just use Debug button (it's there just for that). Also -- https://blog.jetbrains.com/phpstorm/2016/02/debugging-from-the-rest-api-client-in-phpstorm-11/
3) Yes -- setting up cookie manually does work. https://stackoverflow.com/a/19147935/783119
4) Postman works just fine as well (used it recently when was developing some API). I've only typed cookie name and left the rest in their default values.
You have said that you are having hard time to make it work ... even here. As for me it must be something specific to your setup/environment (some nuances) ... or just some misconfiguration.
Andy - how do you debug with the new editor-based client?
I have tried setting the XDEBUG_SESSION cookie on my requests however it doesn't work (and would also be a little annoying to add to every request)
Xdebug triggers when visiting a URL from the browser, but not when making a request.
>Andy - how do you debug with the new editor-based client?
Have not used it properly yet. Don't know ... I do not like it (I'm used to a completely different workflow).
I'm using Postman and it works great for me.
There's no way you can do that with GUI unfortunately: https://youtrack.jetbrains.com/issue/WI-40370
There are two ways now:
http://localhost/index.php?XDEBUG_SESSION_START=1Cookie: XDEBUG_SESSION=1If they didn't work, please show me the exact request you've used.
It worked for me with the GET and the cookie. Thanks Eugene!
Juan you are welcome, but since my last comment, the UI has been improved, you can use it to invoke a debug session: https://youtrack.jetbrains.com/issue/WI-40370#focus=Comments-27-3954097.0-0