Skip to content

Replying with a custom Response #1

@someniatko

Description

@someniatko

First of all, this library is exactly what I was looking for, and I have found nothing comparable to it (php-http/mock-client lib is dated and also very barebones in comparison to this one), thank you!

For now the intended way of crafting a response is to use the library's PockResponseBuilder. However, I'd like to just put my own response implementing PSR's ResponseInterface, like that:

$myResponse = new Response(); // assume Response is a class from some PSR-7 implementation.
$builder = new PockBuilder();
$builder->replyWith($myResponse); // replyWith() is just some suggested method name

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions