Skip to content

HTTP client: Support passing default request headers #449

Closed
@clue

Description

@clue

Here's what this could potentially look like:

$browser = new React\Http\Browser();
$browser = $browser->withProtocolVersion('1.1'); // already supported
$browser = $browser->withHeader('User-Agent', 'ACME'); // could be useful?

$browser->get($url)->then(…);

This isn't currently supported, but seems reasonable and would also allow other packages to take advantage of custom HTTP request headers. What do you think about this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions