Lines Matching refs:request

6 Most PHP scripts run within a HTTP request but accessing information about the
7 HTTP request is cumbersome at least.
73 instantiate a request object is as follows:
80 $request = HTTP\Sapi::getRequest();
84 you should pass this request object around using dependency injection.
89 function handleRequest(HTTP\RequestInterface $request) {
91 // Do something with this request :)
126 information about the current request.
163 `$request = Sapi::getRequest()` at the top of your application,
166 All we know in the current subsystem, is that we received a `$request` and
171 $request = new MyRequest($request);
193 $request = new HTTP\Request('GET', 'http://example.org/');
194 $request->setHeader('X-Foo', 'Bar');
197 $response = $client->send($request);
207 $client->on('beforeRequest', function($request) {
214 $client->on('afterRequest', function($request, $response) {
221 $client->on('error', function($request, $response, &$retry, $retryCount) {
228 $client->on('error:401', function($request, $response, &$retry, $retryCount) {
237 $request->setHeader('Authorization', 'Basic xxxxxxxxxx');
249 The underlying system for this is simply [cURL's multi request handler][8],
258 $request = new Request('GET', 'http://localhost/');
264 $request,
303 $request = Sapi::getRequest();
304 $request->setBaseUrl($myBaseUrl);
306 $subRequest = clone $request;
312 $subRequest->setUrl($remoteUrl . $request->getPath());
316 // Sends the HTTP request to the server
331 * Creates the request object
356 * Returns the request url.
363 * Sets the request url.