cancel
Showing results for 
Search instead for 
Did you mean: 

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

Epena
Participant

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.

Former Member
0 Kudos

Have you got solution on this ? I am also trying to figure out how to debug the same ?

Epena
Participant
0 Kudos

Sorry, no solution so far...

Former Member
0 Kudos

jacobtan , yatsea.li Any thoughts ? How can I implement the same ?

buz
Explorer
0 Kudos

Hi all,

I'm trying the procedure exposed by Florian:

  • update Postman with "Postman Interceptor" installed
  • enabled it within the "satellite" button (now it's connected)
  • got the xsDebugToken
  • added in the Headers tab of the Postman the key "Cookie" with the xsDebugToken value
  • put the breakpoint in the XSJS program

When I send the JSON through Postman the program doesn't stop at the breakpoint...

Thank you for your help!

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

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

Epena
Participant
0 Kudos

This worked, Thanks!

vanama1
Explorer
0 Kudos

I exactly did the way it was mentioned, but the send button in postman does not stop on the break point on webide dev workbench. when I click play button on the webide dev workbench, it is being treated as a GET call rather.

Answers (0)