Skip to content

fix: expose hackney:body/1,2 and stream_body/1 (#849)#853

Merged
benoitc merged 1 commit into
masterfrom
fix/849-public-body-helper
May 25, 2026
Merged

fix: expose hackney:body/1,2 and stream_body/1 (#849)#853
benoitc merged 1 commit into
masterfrom
fix/849-public-body-helper

Conversation

@benoitc
Copy link
Copy Markdown
Owner

@benoitc benoitc commented May 25, 2026

Fixes #849.

The migration guide (streaming request body section) and the examples tell users to read the response body with hackney:body/1 after start_response/1, but body/1, body/2 and stream_body/1 were not exported from the hackney module. After a streamed request body there was no public way to read the response.

Re-exposes hackney:body/1, hackney:body/2 and hackney:stream_body/1 as thin wrappers over the existing hackney_conn functions (already used internally by the sync path).

Docs fixed too:

  • GETTING_STARTED.md showed reading a regular GET body via hackney:body(Ref) and referenced the removed with_body option; in 4.x the body is returned directly in the response tuple.
  • The migration guide summary called body/stream_body removed, while its own streaming section uses them after start_response/1.
  • README.md streaming example now shows reading the response with hackney:body/1.

Adds an integration test that streams a request body and reads the response with hackney:body/1.

The migration guide and examples tell users to read the response body
with hackney:body/1 after start_response/1 in streaming body mode, but
the functions were not exported from the hackney module, so there was no
public way to read the response after a streamed request.

Re-export body/1, body/2 and stream_body/1 as thin wrappers over
hackney_conn. Also fix the docs: GETTING_STARTED showed reading a regular
GET body via body/Ref (the body is returned directly in 4.x) and
referenced the removed with_body option; the migration summary called
body/stream_body removed when they are still used after start_response.
@benoitc benoitc merged commit 12fd385 into master May 25, 2026
5 checks passed
@benoitc benoitc deleted the fix/849-public-body-helper branch May 25, 2026 16:38
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.

How to stream request without streaming response?

1 participant