on 2022 Nov 07 10:13 PM
Hi,
I have a scenario where I need to access the remote service response headers after having made a call like so
const svc = await cds.connect.to('someservice')
let results = svc.tx(req).send(somequery);
// Here, results contains the parsed response payload, but I cannot find the response headers
What is the appropriate way to do this? I have tried constructing a cds.Request first and then emitting it, but I cannot find the headers anywhere in the request object after the call completes either.
Thanks!
//Carl
You can use SAP Cloud SDK to get raw response for your request and then parse it as per you needs.
https://sap.github.io/cloud-sdk/docs/js/features/odata/execute-request#getting-the-raw-response-and-...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had to use this to get the CSRF token when calling an S/4HANA Cloud API.
More details of my journey in here: https://stackoverflow.com/questions/40788905/csrf-token-validation-failed-in-nodejs-while-posting-da...
User | Count |
---|---|
67 | |
11 | |
10 | |
10 | |
9 | |
9 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.