Http
class Http extends Facade (View source)
Properties
static protected Application|null | $app | The application instance being facaded. |
from Facade |
static protected array | $resolvedInstance | The resolved object instances. |
from Facade |
static protected bool | $cached | Indicates if the resolved instance should be cached. |
from Facade |
Methods
Create a fresh mock instance for the given class.
Get the registered name of the component.
Resolve the facade root instance from the container.
Get the application instance behind the facade.
Handle dynamic, static calls to the object.
Register a response sequence for the given URL pattern.
Indicate that an exception should be thrown if any request is not faked.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
in
Facade at line 47
static void
resolved(Closure $callback)
Run a Closure when the facade has been resolved.
static protected MockInterface
createFreshMockInstance()
Create a fresh mock instance for the given class.
static protected mixed
resolveFacadeInstance(string $name)
Resolve the facade root instance from the container.
static Factory
fake(Closure|array $callback = null)
Register a stub callable that will intercept requests and be able to return stub responses.
static ResponseSequence
fakeSequence(string $urlPattern = '*')
Register a response sequence for the given URL pattern.
static Factory
preventStrayRequests(bool $prevent = true)
Indicate that an exception should be thrown if any request is not faked.
static Factory
stubUrl(string $url, Response|PromiseInterface|callable $callback)
Stub the given URL using the given callback.
static PromiseInterface
response(array|string|null $body = null, int $status = 200, array $headers = [])
No description
static PendingRequest
withBody(StreamInterface|string $content, string $contentType = 'application/json')
No description
static PendingRequest
attach(string|array $name, string|resource $contents = '', string|null $filename = null, array $headers = [])
No description
static PendingRequest
retry(array|int $times, Closure|int $sleepMilliseconds, callable|null $when = null, bool $throw = true)
No description
static RequestInterface
runBeforeSendingCallbacks(RequestInterface $request, array $options)
No description
static PendingRequest|mixed
when(Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null)
No description