Skip to content

HttpMethodsClient not working with PSR-17 #201

Closed
@jdecool

Description

@jdecool

Description
The HttpMethodsClient constructor allows to get an RequestFactory or RequestFactoryInterface as second parameter.

Both declare the createRequest but don't have the same argument.

RequestFactoryInterface::createRequest only have two parameters method and uri.

The HttpMethodsClient::send method which is used to make the HTTP call have two other parameters. So when using a PSR-17 implementation, the code will not work as the body and/or headers won't be sent.

How to reproduce

$http = new HttpMethodsClient(HttpClientDiscovery::find(), Psr17FactoryDiscovery::findRequestFactory());
$response = $http->get($uri, $headers);

Headers will not be sent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions