on 03-01-2022 1:40 PM
Hello,
How can I add custom headers to the executeHttpRequest call?
This does not work, my custom headers are removed:
await executeHttpRequest({ destinationName: "my_dest" }, {
method: 'GET',
url: '/url',
headers: {
"my-custom-header": 'test'
}
})
I am using: "@sap-cloud-sdk/http-client": "^2.1.0"
Thanks, Zsolti
Hey Zsolt,
thank you for reaching out to us, this particular use case isn't very well documented and will be added to the docs in the future.
Instead of directly writing your header into the header field, write it like this:
headers: {
custom: {
authorization: 'custom-auth-header',
'content-type': 'application/json',
accept: 'application/json'
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.