Skip to content

Feature Request: Peeking at the beginning of the body (without getting the whole thing) #215

@epitron

Description

@epitron

I've found myself recently needing the ability to read just the beginning of an HTTP response (just the first 1k), and it doesn't seem like Mechanize is currently outfitted to do this.

Pluggable Parsers let me get a body_io, so I tried to read just the first 400 bytes and then close it. No dice, unfortunately! Mechanize ends up downloading the whole thing!

Is there an easy way to do this? Or would this be a nasty hack?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions