String / Plain Text Body
<?php
use Saloon\Http\Request;
use Saloon\Contracts\Body\HasBody as HasBodyContract;
class CreateServerRequest extends Request implements HasBodyContract
{
protected Method $method = Method::POST;
}<?php
use Saloon\Http\Request;
use Saloon\Traits\Body\HasBody;
use Saloon\Contracts\Body\HasBody as HasBodyContract;
class CreateServerRequest extends Request implements HasBodyContract
{
use HasBody;
protected Method $method = Method::POST;
// Define our own Content-Type...
protected function defaultHeaders(): array
{
return [
'Content-Type' => 'text/plain',
];
}
}Default Body
Interacting with the body() method
Connector Body
Last updated