Join Justin Yost for an in-depth discussion in this video Processing response headers, part of Consuming RESTful APIs in PHP with Guzzle.
- [Instructor] So the next part we need…to work with is the response headers.…First, what is a header?…Well, a header is basically status…information about an HTTP response, or request.…This includes everything from the user agent,…what data formats the client accepts,…the date of the message,…and what language the message is encoded in,…and what language to return any responses in.…In short, the headers give you the metadata…about a request and a matching response.…
To work with the header some,…we'll open and copy the first .php file,…we'll create a new file,…labeled headers.php,…paste in our contents.…Now we'll start off first by just getting a list…of the headers from the response.…To do this, we'll edit line 12 to read as…our variable headers is going to be equal to…response and call the method getHeaders.…
At this point, let's see what all our headers look like.…Our getHeaders method returns an array,…so first, we'll loop over the array,…by adding in a foreach loop.…Headers as name value.…And inside the foreach loop,…
- 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 36m 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.