laravel-transporter icon indicating copy to clipboard operation
laravel-transporter copied to clipboard

SendsXml for Concurrently

Open osroflo opened this issue 2 years ago • 1 comments

How can I implement SendsXml using Concurrently?

class AdequateShopRequest extends Request
{
    use SendsXml;
    protected string $method = 'POST';
    protected string $baseUrl = 'https://webservice.com';
    protected array $data = [];
}


$responses = Concurrently::build()->setRequests([
        AdequateShopRequest::build()->setPath('/something')->withXml($xml_body),
])->run();

Error: Typed property JustSteveKing\Transporter\Request::$request must not be accessed before initialization ../vendor/juststeveking/laravel-transporter/src/Concerns/SendsXml.php:17

Or if there is a way to set the contentType as property and just pass the body, something like this:

class AdequateShopRequest extends Request
{
    protected string $method = 'POST';
    protected string $baseUrl = 'https://webservice.com';
    protected string $contentType = 'application/xml';
}

$responses = Concurrently::build()->setRequests([
        AdequateShopRequest::build()->setPath('/something')->setBody($xml_body),
])->run();

osroflo avatar Mar 01 '22 05:03 osroflo

Should the SendsXml::send method include a call to ensuresRequest?

abbajbryant avatar Oct 25 '22 21:10 abbajbryant