Join Justin Yost for an in-depth discussion in this video PSR-7 responses, part of Consuming RESTful APIs in PHP with Guzzle.
- [Instructor] Now that we've seen how to deal with…and process a PSR-7 style request,…let's see PSR-7 style responses.…To do this, we'll open up our first.php file.…And copy it.…And then we'll create a new file,…and we'll name is psr7response.php.…And we'll paste in the contents from our first.php file.…So what can we do at this point?…Well first, what is our response?…The response is our PSR-7 object that includes…very few methods that we get back when we call…the client request that responds…allows us to get both the status code and status…message of our response.…
To do this, we can edit line 12…to read as echo, response, get status code.…We'll also go ahead and add on here our new line string,…so I then dot,…and then in double quotes, backspace R, backspace N.…We'll copy this and duplicate it for line 13.…And we'll edit line 13 to instead call the method…get reason phrase.…
Let's save this and see what happens.…We'll go to our command line tool and run the command…PHP, psr7response.php.…And that's really about all we get…
- 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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.