I have a JSON object containing HTTP request information:
"http": {
"method": "POST",
"headers": [{
"content-type": "application/json"
}, {
"Authorization": "KKYZASSHUYTRJ"
}],
"url": "http://localhost:8888/download/context"
}
Within this JSON, I need to access the headers and iterate through the array. The keys of the "headers" object are subject to change. I am seeking a method in Typescript/Javascript to retrieve both the keys and values from the headers in order to construct an HTTP call.
While many Stackoverflow articles provide solutions for accessing values using keys, I am specifically inquiring about how to handle both keys and values.
Although Object.getkeys() and Object.getValues() are available, they are not compatible with Safari. As a result, I am exploring alternative methods.