Codrin Strîmbei
Codrin Strîmbei

Reputation: 125

SAP CPI HTTP Post how to pass token

I need to send a POST in CPI to a s4hana service, and in order to pass it directly in JSON, not in xml, I want to use the simple HTTP adapter.

How can I get the token with a GET and use it with a POST afterwards?

Upvotes: 0

Views: 3199

Answers (1)

dotchuZ
dotchuZ

Reputation: 2641

do the GET, parse the XML and save the token as a variable in message header. Use the message header variable in your POST via filling the JSON with ${header.yourVariableName}

see this: https://blogs.sap.com/2018/01/18/sap-cpi-clearing-the-headers-reset-header/ http://blog.whint.de/runtime-variables-cpi/

Upvotes: 1

Related Questions