Http
class Http extends Facade
Properties
| static protected | $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
Get the registered name of the component.
Resolve the facade root instance from the container.
Clear a resolved facade instance.
Handle dynamic, static calls to the object.
Register a stub callable that will intercept requests and be able to return stub responses.
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
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 55
static void
resolved(Closure $callback)
Run a Closure when the facade has been resolved.
Boot-only. The callback is registered on the worker-global container and runs for every subsequent resolution of the facade accessor.
in
Facade at line 71
static
spy()
Convert the facade into a Mockery spy.
in
Facade at line 89
static
partialMock()
Initiate a partial mock on the facade.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 105
static
shouldReceive()
Initiate a mock expectation on the facade.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 121
static
expects()
Initiate a mock expectation on the facade.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 135
static protected
createFreshMockInstance()
Create a fresh mock instance for the given class.
in
Facade at line 147
static protected
createMock()
Create a fresh mock instance for the given class.
in
Facade at line 157
static protected bool
isMock()
Determines whether a mock is set as the instance of the facade.
in
Facade at line 168
static protected string|null
getMockableClass()
Get the mockable class for the bound instance.
in
Facade at line 184
static
swap(mixed $instance)
Hotswap the underlying instance behind the facade.
Tests only. Replaces the worker-wide resolved facade instance and container binding; runtime use races across coroutines and changes every subsequent facade call.
in
Facade at line 196
static bool
isFake()
Determines whether a "fake" has been set as the facade instance.
in
Facade at line 207
static mixed
getFacadeRoot()
Get the root object behind the facade.
at line 165
static protected string
getFacadeAccessor()
Get the registered name of the component.
in
Facade at line 223
static protected mixed
resolveFacadeInstance(string $name)
Resolve the facade root instance from the container.
in
Facade at line 246
static void
clearResolvedInstance(string|null $name = null)
Clear a resolved facade instance.
Boot or tests only. Clears a worker-wide facade cache entry; concurrent coroutines may still hold the previous resolved instance.
in
Facade at line 257
static void
clearResolvedInstances()
Clear all of the resolved instances.
Boot or tests only. Clears the worker-wide facade cache; concurrent coroutines may still hold previously resolved instances.
in
Facade at line 265
static Collection
defaultAliases()
Get the application default aliases.
in
Facade at line 324
static
getFacadeApplication()
Get the application instance behind the facade.
in
Facade at line 337
static void
setFacadeApplication(mixed $app)
Set the application instance.
Tests only. Replaces the worker-wide facade application reference; runtime use races across coroutines and breaks every facade lookup.
in
Facade at line 347
static
__callStatic(string $method, array $args)
Handle dynamic, static calls to the object.
at line 126
static Factory
fake(array|callable|null $callback = null)
Register a stub callable that will intercept requests and be able to return stub responses.
at line 136
static ResponseSequence
fakeSequence(string $urlPattern = '*')
Register a response sequence for the given URL pattern.
at line 148
static Factory
preventStrayRequests(bool $prevent = true)
Indicate that an exception should be thrown if any request is not faked.
at line 158
static Factory
stubUrl(string $url, array|callable|int|PromiseInterface|Response|string $callback)
Stub the given URL using the given callback.
at line 121
static Factory
globalMiddleware(callable $middleware)
No description
at line 121
static Factory
globalRequestMiddleware(callable $middleware)
No description
at line 121
static Factory
globalResponseMiddleware(callable $middleware)
No description
at line 121
static Factory
globalOptions(Closure|array $options)
No description
at line 121
static PromiseInterface
response(mixed $body = 'null', int $status = '200', array $headers = '[]')
No description
at line 121
static Response
psr7Response(mixed $body = 'null', int $status = '200', array $headers = '[]')
No description
at line 121
static RequestException
failedRequest(mixed $body = 'null', int $status = '200', array $headers = '[]')
No description
at line 121
static Closure
failedConnection(string|null $message = 'null')
No description
at line 121
static ResponseSequence
sequence(array $responses = '[]')
No description
at line 121
static bool
preventingStrayRequests()
No description
at line 121
static Factory
allowStrayRequests(array|null $only = 'null')
No description
at line 121
static void
recordRequestResponsePair(Request $request, Response|null $response)
No description
at line 121
static void
assertSent(callable $callback)
No description
at line 121
static void
assertSentInOrder(array $callbacks)
No description
at line 121
static void
assertNotSent(callable $callback)
No description
at line 121
static void
assertNothingSent()
No description
at line 121
static void
assertSentCount(int $count)
No description
at line 121
static void
assertSequencesAreEmpty()
No description
at line 121
static Collection
recorded(callable|null $callback = 'null')
No description
at line 121
static PendingRequest
createPendingRequest()
No description
at line 121
static Dispatcher|null
getDispatcher()
No description
at line 121
static array
getGlobalMiddleware()
No description
at line 121
static Factory
registerConnection(string $name, array $config = '[]')
No description
at line 121
static bool
hasConnection(string $name)
No description
at line 121
static callable
getConnectionHandler(string $name)
No description
at line 121
static ClientInterface
createClient(HandlerStack $handlerStack, CookieJar $cookies)
No description
at line 121
static array
getConnectionConfigs()
No description
at line 121
static array
getConnectionConfig(string $name)
No description
at line 121
static array
getConnectionOptions(string $name)
No description
at line 121
static Factory
setConnectionConfig(string $name, array $config)
No description
at line 121
static void
macro(string $name, callable|object $macro)
No description
at line 121
static void
mixin(object $mixin, bool $replace = 'true')
No description
at line 121
static bool
hasMacro(string $name)
No description
at line 121
static void
flushMacros()
No description
at line 121
static mixed
macroCall(string $method, array $parameters)
No description
at line 121
static PendingRequest
baseUrl(string $url)
No description
at line 121
static PendingRequest
withBody(mixed $content, string $contentType = '\'application/json\'')
No description
at line 121
static PendingRequest
asJson()
No description
at line 121
static PendingRequest
asForm()
No description
at line 121
static PendingRequest
attach(array|string $name, resource|string $contents = '\'\'', string|null $filename = 'null', array $headers = '[]')
No description
at line 121
static PendingRequest
asMultipart()
No description
at line 121
static PendingRequest
bodyFormat(string $format)
No description
at line 121
static PendingRequest
withQueryParameters(array $parameters)
No description
at line 121
static PendingRequest
contentType(string $contentType)
No description
at line 121
static PendingRequest
acceptJson()
No description
at line 121
static PendingRequest
accept(string $contentType)
No description
at line 121
static PendingRequest
withHeaders(array $headers)
No description
at line 121
static PendingRequest
withHeader(string $name, mixed $value)
No description
at line 121
static PendingRequest
replaceHeaders(array $headers)
No description
at line 121
static PendingRequest
withBasicAuth(string $username, string $password)
No description
at line 121
static PendingRequest
withDigestAuth(string $username, string $password)
No description
at line 121
static PendingRequest
withNtlmAuth(string $username, string $password)
No description
at line 121
static PendingRequest
withToken(string $token, string $type = '\'Bearer\'')
No description
at line 121
static PendingRequest
withUserAgent(string|bool $userAgent)
No description
at line 121
static PendingRequest
withUrlParameters(array $parameters = '[]')
No description
at line 121
static PendingRequest
withCookies(array $cookies, string $domain)
No description
at line 121
static PendingRequest
maxRedirects(int $max)
No description
at line 121
static PendingRequest
withoutRedirecting()
No description
at line 121
static PendingRequest
withoutVerifying()
No description
at line 121
static PendingRequest
sink(resource|string $to)
No description
at line 121
static PendingRequest
timeout(int|float $seconds)
No description
at line 121
static PendingRequest
connectTimeout(int|float $seconds)
No description
at line 121
static PendingRequest
retry(array|int $times, Closure|int $sleepMilliseconds = '0', callable|null $when = 'null', bool $throw = 'true')
No description
at line 121
static PendingRequest
withOptions(array $options)
No description
at line 121
static PendingRequest
withMiddleware(callable $middleware)
No description
at line 121
static PendingRequest
withRequestMiddleware(callable $middleware)
No description
at line 121
static PendingRequest
withResponseMiddleware(callable $middleware)
No description
at line 121
static PendingRequest
withAttributes(array $attributes)
No description
at line 121
static PendingRequest
withoutTelescope()
No description
at line 121
static PendingRequest
withTelescopeTags(array $tags)
No description
at line 121
static PendingRequest
beforeSending(callable $callback)
No description
at line 121
static PendingRequest
afterResponse(callable $callback)
No description
at line 121
static PendingRequest
throw(callable|null $callback = 'null')
No description
at line 121
static PendingRequest
throwIf(callable|bool $condition)
No description
at line 121
static PendingRequest
throwUnless(callable|bool $condition)
No description
at line 121
static PendingRequest
dump()
No description
at line 121
static PendingRequest
dd()
No description
at line 121
static Response
get(string $url, JsonSerializable|array|string|null $query = 'null')
No description
at line 121
static Response
head(string $url, array|string|null $query = 'null')
No description
at line 121
static Response
post(string $url, JsonSerializable|array $data = '[]')
No description
at line 121
static Response
patch(string $url, array $data = '[]')
No description
at line 121
static Response
put(string $url, array $data = '[]')
No description
at line 121
static Response
delete(string $url, array $data = '[]')
No description
at line 121
static Response
send(string $method, string $url, array $options = '[]')
No description
at line 121
static ClientInterface
buildClient()
No description
at line 121
static HandlerStack
buildHandlerStack()
No description
at line 121
static HandlerStack
pushHandlers(HandlerStack $handlerStack)
No description
at line 121
static Closure
buildBeforeSendingHandler()
No description
at line 121
static Closure
buildRecorderHandler()
No description
at line 121
static Closure
buildStubHandler()
No description
at line 121
static RequestInterface
runBeforeSendingCallbacks(RequestInterface $request, array $options)
No description
at line 121
static array
mergeOptions(mixed ...$options)
No description
at line 121
static PendingRequest
stub(Collection|callable $callback)
No description
at line 121
static bool
isAllowedRequestUrl(string $url)
No description
at line 121
static PendingRequest
async(bool $async = 'true')
No description
at line 121
static PromiseInterface|null
getPromise()
No description
at line 121
static PendingRequest
truncateExceptionsAt(int $length)
No description
at line 121
static PendingRequest
dontTruncateExceptions()
No description
at line 121
static PendingRequest
setClient(ClientInterface $client)
No description
at line 121
static PendingRequest
setHandler(callable $handler)
No description
at line 121
static array
getOptions()
No description
at line 121
static PendingRequest
connection(string $connection, array|null $config = 'null')
No description
at line 121
static string|null
getConnection()
No description
at line 121
static PendingRequest|mixed
when(Closure|mixed $value = 'null', null|callable $callback = 'null', null|callable $default = 'null')
No description
at line 121
static PendingRequest|mixed
unless(Closure|mixed $value = 'null', null|callable $callback = 'null', null|callable $default = 'null')
No description