How to move context requestId and caller to the HTTP headers?

We’re trying to encrypt our payload before sending the request to other endpoint.
And before that we want to move anything that shouldn’t be encrypted to the HTTP header.

So far, these are the attributes that we identified not to be encrypted.

– event.requestContext.requestId

– event.requestContext.requestId.identity.caller

So, my question is, how do I get these attributes before sending the request?

If you debug with

console.log(“event is: “, event);

what’s output in the logs? Will you see the information you are looking for?

When the request arrives at the destination endpoint, I can see those two attributes under event object.

– event.requestContext.requestId

– event.requestContext.requestId.identity.caller

But. what I want to figure out is when the request is not yet sent/transferred. Meaning, from the source endpoint, I want to get these values and then send the request to the destination endpoint.