Skip to Content

How to debug XSJS POST method using external tools (POSTMAN)

Hello,

I'm developing an XSJS service. Such service responds to GET and POST requests. I can debug the GET method by setting a break point in the source code on the web editor and click "RUN". However, POST requests have to be sent through external tools like POSTMAN, but whenever I send POST or GET requests using such tool, it does not stop at break points.

How can I debug server js code while POSTing data?

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 29 at 12:02 PM

    Hi,

    XS classic uses a xsDebugToken browser cookie which is set automatically by the web-based dev workbench or HANA studio.

    To make it work with Postman, you need to do the following things:

    • Postman Interceptor to be able to send requests with browser cookies
    • Enable Postman Interceptor in your Postman installation (on the top bar of Postman, it is the "satellite" button)
    • Get the xsDebugToken: For that run an xsjs service within e.g. the web-based dev workbench and check the Cookie request header within the e.g. Google Chrome developer tools. There you find (normally at the end) xsDebugToken=xxxxyyyy (xxxxyyyy is a placeholder for the value which you should see).
    • Get the xsDebugToken=xxxxyyyy value and add the value in Postman as "Cookie" header for your request. If Postman Interceptor is successfully connected you should get no warning, that the Cookie header is a restricted header.
    • Execute the request and than the debugger should stop on your breakpoint (you need to switch back to the web-based dev workbench browser window).

    Regards,
    Florian

    Add comment
    10|10000 characters needed characters exceeded