MakesHttpRequests
trait MakesHttpRequests (View source)
Properties
Methods
$this
withHeaders(array $headers)
Define additional headers to be sent with the request.
$this
withHeader(string $name, string $value)
Add a header to be sent with the request.
$this
withoutHeader(string $name)
Remove a header from the request.
$this
withoutHeaders(array $headers)
Remove headers from the request.
$this
withToken(string $token, string $type = 'Bearer')
Add an authorization token for the request.
$this
withBasicAuth(string $username, string $password)
Add a basic authentication header to the request with the given credentials.
$this
withoutToken()
Remove the authorization token from the request.
$this
flushHeaders()
Flush all the configured headers.
$this
withServerVariables(array $server)
Define a set of server variables to be sent with the requests.
$this
withoutMiddleware(string|array|null $middleware = null)
Disable middleware for the test.
handle($request, $next)
No description
Details
$this
withBasicAuth(string $username, string $password)
Add a basic authentication header to the request with the given credentials.
$this
withServerVariables(array $server)
Define a set of server variables to be sent with the requests.