You can just use JavaScript:
const xhr = new XMLHttpRequest();
xhr.open("GET", "https://jsonplaceholder.typicode.com/posts/1");
xhr.send();
xhr.responseType = "json";
xhr.onload = () => {
if (xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr.response);
} else {
console.log(`Error: ${xhr.status}`);
}
};
https://www.freecodecamp.org/news/javascript-get-request-tutorial/
to initialize your own POST, GET, and any of type:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods
But I do not know a way to intercept headers from website within WebDriver .