From 86ade6ddcaf5be09edb32d78e703691e07917861 Mon Sep 17 00:00:00 2001 From: cedric05 Date: Fri, 12 Jun 2026 12:54:13 +0530 Subject: [PATCH] feat: include request headers in execute response (v0.0.44a33) Previously the execute response only contained response headers. The request headers (Authorization, Content-Type, User-Agent, and any custom headers set in the .http file) were never serialised into the result payload, so the VS Code notebook renderer had no way to display them. Changes: - basic_handlers.py: in `get_request_result`, capture `dict(resp.request.headers)` and store it under the `request_headers` key in the result. Uses PreparedRequest headers so it reflects the exact headers sent on the wire, including headers added automatically by the `requests` library (e.g. User-Agent, Accept-Encoding, Content-Length). - pyproject.toml: bump version to 0.0.44a33 --- dotextensions/server/handlers/basic_handlers.py | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dotextensions/server/handlers/basic_handlers.py b/dotextensions/server/handlers/basic_handlers.py index fbbe0d4..d7dac58 100644 --- a/dotextensions/server/handlers/basic_handlers.py +++ b/dotextensions/server/handlers/basic_handlers.py @@ -181,6 +181,7 @@ def get_request_result(self, command, comp: RequestCompiler): data = {} data.update(response_data["response"]) # deprecated data.update(response_data) + data["request_headers"] = dict(resp.request.headers) if not comp.args.no_cookie and "cookie" in resp.request.headers: # redirects can add cookies comp.httpdef.headers["cookie"] = resp.request.headers["cookie"] diff --git a/pyproject.toml b/pyproject.toml index aa22d2c..2d2aa2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dothttp-req" -version = "0.0.44a32" +version = "0.0.44a33" description = "Dothttp is Simple http client for testing and development" authors = ["Prasanth "] license = "MIT"