laravel-transporter
laravel-transporter copied to clipboard
SendsXml for Concurrently
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();
Should the SendsXml::send method include a call to ensuresRequest?