Skip to content

feat(rest): wrap catalog responses in HttpResponse - #2996

Open
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:fix/rest-followup-nits
Open

feat(rest): wrap catalog responses in HttpResponse#2996
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:fix/rest-followup-nits

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Aug 14, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #2993.

What changes are included in this PR?

#2838 added HttpRequest; responses were still unwrapped. This adds the counterpart.

  • New response.rs (mirroring request.rs) with HttpResponse { status, headers, body }. query_catalog and post_form return it, so reqwest::Response no longer appears outside HttpClientcatalog.rs doesn't even import it any more.
  • deserialize_catalog_response and deserialize_unexpected_catalog_error are no longer async: the body is already read.
  • post_form returns HttpResponse instead of (StatusCode, Vec<u8>). Breaking, but that method landed in #2838 and hasn't been released.

The body is buffered as a Vec<u8> (not bytes::Bytes, to keep another third-party type out of the public API), and Debug is hand-written since a token exchange answers with a credential in the body.

Buffering is eager, so a body-read failure now surfaces on paths that ignored the body before — a drop_table that gets 200 and then loses the connection used to return Ok(()) and now errors. Narrow window, and failing loudly seems right, but it is a semantic change. HEAD/204/304 are unaffected.

Also cleared this crate's cargo doc warnings, which aren't a CI gate today — including a dangling Self::without_session link left by the rename in #2994.

Are these changes tested?

76 tests. New ones pin HttpResponse round-tripping status/headers/body through a real response, Debug holding back the body and sensitive headers, the unexpected-status error carrying status/headers/body, and a truncated-body error naming its URL — the last three were previously unpinned.

@plusplusjiajia
plusplusjiajia force-pushed the fix/rest-followup-nits branch from 75a8a7e to ec97576 Compare August 14, 2026 06:20
@plusplusjiajia
plusplusjiajia force-pushed the fix/rest-followup-nits branch from ec97576 to ab0be9a Compare August 14, 2026 06:58
@plusplusjiajia
plusplusjiajia marked this pull request as ready for review August 14, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rest: wrap responses in HttpResponse to complete the HTTP abstraction

1 participant