String / Plain Text Body
<?php
use Saloon\Http\Request;
use Saloon\Contracts\Body\HasBody;
class CreateServerRequest extends Request implements HasBody
{
protected Method $method = Method::POST;
}<?php
use Saloon\Http\Request;
use Saloon\Contracts\Body\HasBody;
use Saloon\Traits\Body\HasStringBody;
class CreateServerRequest extends Request implements HasBody
{
use HasStringBody;
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