Join Justin Yost for an in-depth discussion in this video Sending asynchronous requests, part of Consuming RESTful APIs in PHP with Guzzle.
- [Narrator] Let's work now on sending…an asynchronous request.…First, let's explore what we…mean by an asynchronous request.…An asynchronous request means a request…in which we can do other stuff at the same time.…We'll explore this in greater detail later on in this video.…For now, let's just set up to build asynchronous request.…To begin, open up the first .PHP file we were working with.…We'll copy all of the file, and create a new file,…labeled async.PHP, and paste in the contents from first.PHP.…
And what we have here is the basic request pattern…that we've already seen a few times now.…To change this to be an asynchronous request…we just need to change on line six the method call…for request to request capital A async.…We'll save this, and then we can navigate…to our terminal application, and run the code…by running the command PHP async.PHP,…and at this time we get a fatal error.…
Well, why is that?…It says that the method get body…is undefined for the promise class.…Wait a minute.…But earlier we were returning a response object.…
- Installing Guzzle
- Sending basic requests
- Sending asynchronous requests
- Sending concurrent requests
- Sending query data
- Sending request data
- Advanced Guzzle request options
- Reviewing basic Guzzle responses
- Processing response headers
- Reviewing PSR-7 requests, responses, bodies, and headers
Skill Level Intermediate
PHP: Clean URLs on Apache Serverwith David Powers1h 35m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
1. Guzzle Basics
2. Requests with Guzzle
3. Responses with Guzzle
4. Guzzle and PSR-7
5. Testing and Guzzle
Next steps1m 12s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.