Asc_session_id to asc_xsrf_token using only APIkey id and Key Secret


I would like to ask how to reuse
the response header values
on the succeeding calls on a and automatically create a header for it?

what if the creds are api key id and secret that is on the body of the first post, say login post. then the asc_ssession_id is generated on the response header.

how can i use the value of the header if the succeeding api calls need the value but with a different header, say asc_xsrf_token?