HTTP Clients with Laravel: Use and Consume Services and APIs
4.3 (25 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
265 students enrolled
Wishlisted Wishlist

Please confirm that you want to add HTTP Clients with Laravel: Use and Consume Services and APIs to your Wishlist.

Add to Wishlist

HTTP Clients with Laravel: Use and Consume Services and APIs

Learn to perform requests over HTTP with Laravel. Use Web Services and APIs online using PHP and Laravel
4.3 (25 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
265 students enrolled
Created by JuanD MeGon
Last updated 6/2017
English
Curiosity Sale
Current price: $10 Original price: $65 Discount: 85% off
30-Day Money-Back Guarantee
Includes:
  • 3.5 hours on-demand video
  • 9 Articles
  • 1 Supplemental Resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Master the latest technologies for the web development
  • Use agile and effective tools to develop professional web projects
  • Agile development of high complexity projects
  • Advanced and professional knowledge about web development with PHP
  • Deeper knowledge about HTTP and how to consume HTTP-based services
  • Ability to create online projects and platforms to consume online data
  • Comprehension about the components to consume and requests services online using PHP
View Curriculum
Requirements
  • PHP Programming skills (not advanced required)
  • Preferably, but not required, basic knowledge about POO
  • Basic usage of the operating system tools (environment, command prompt, etc)
  • Knowledge about installation and configuration of new tools in your operating system
  • Eager to Learn
Description

Create your own HTTP Client: Build and design your own web project with Laravel, to consume services and APIs online.

During this course, you are going to learn all the required skills and concepts to consume from your own Laravel, PHP project, whatever service or API online.

Along this course, you are going to see how to perform requests over HTTP directly from your PHP code on Laravel. 

Use whatever method of the HTTP protocol (GET, POST, PUT, PATCH and DELETE), to consume whatever service online that runs over HTTP, all of this directly from your own project with PHP and through advanced dependencies and facilities of Laravel, the PHP framework.


What are you going to learn?

  • Learn, what is HTTP and how it works
  • How to use different HTTP methods like (GET, POST, PUT, PATCH o DELETE)
  • How to consume/request services or projects online over HTTP, using Laravel
  • Install and configure your own development environment with very useful tools
  • Prepare and create an accurate development environment for Laravel and PHP projects
  • Install Laravel directly in your system
  • Configure Laravel in your system for an optimal development
  • How to create routes, views (with Bootstrap 3), layouts, controllers and much more, with Laravel
  • Build a professional and scalable project with Laravel
  • Use Guzzle HTTP to perform requests over HTTP with Laravel
  • Configure your HTTP Client to perform requests over HTTP and HTTPS
  • Request and create online data with a friendly user interface with Bootstrap 3 and Laravel
  • Use Bootstrap 3 in the right way and easily with the right development tools
  • Develop responsive templates and views with Bootstrap 3 directly in Laravel
  • Configure and use in a good way the code editor, Sublime Text 3
  • Use and take advantage of PHP artisan of Laravel to generate code and components
  • Handle and manage exceptions and errors for your HTTP Client with Laravel
  • Consume protected services sending authorization headers and access_token
  • Many further contents

Take full advantage of your tools and services (Sublime Text 3, PHP, Apache, Composer, PHP artisan, Laravel) and improve your agility and productivity to develop your projects.


What is HTTP?

HTTP stands for HyperText Transfer Protocol, which define HTTP as a protocol to transfer hypertext over the Internet. HTTP defines a set of methods/verbs and status codes to specify the way as how two points must establish a communication. 

Many programming languages provide mechanisms to perform or receive HTTP requests and, of course, PHP is one of them, including therefore Laravel.


What is an HTTP Client?
In this context, an HTTP Client is a system capable of performing requests using the HTTP protocol to one or several systems or services, normally online, which one are capable of receiving requests over HTTP as well. Of course, an HTTP Client can only establish a connection with another system that works over HTTP too.

When a system performs a request over HTTP to an external service, that system becomes to an HTTP Client.

In this way whatever system, implemented in whatever language, like PHP, using whatever framework like Laravel, performs an HTTP requests becomes to an HTTP Client for any other service independently of the programming language (PHP - Laravel or not).


What is Laravel?

Laravel is the most popular PHP framework. With Laravel, you are going to be capable of developing whatever project, platform or system that you need using directly PHP and the best practices.
Laravel provides many features that allow you to implement your own complex or not features in short time and easily.


It does not end here! You will have for life access; it means that you can see the new classes, versions and sections of this course at any moment during your entire life.

What are you waiting for?Be a PHP professional with Laravel and take advantage of the web data with your own HTTP Client.

See you in classes!

Who is the target audience?
  • Who wants to increase the level of his knowledge and skills
  • Who wants programming solutions to consume and request data over the web
  • Who wants a better comprehension of the other side of a system: The clients
Students Who Viewed This Course Also Viewed
Curriculum For This Course
52 Lectures
03:40:09
+
Introduction
2 Lectures 06:27

Meet the instructor and learn some details about him: experience and skills. See what are you going to learn, during the whole course, and specific details about the results obtained along the classes

Preview 01:50

It is very common that certain terms and concepts of the world of web services or web applications in general, are a bit confusing leading to misunderstandings and even bad implementations. During this class, you are going to take a little view for the world of web services and APIs, terminologies, differences and technologies involved in this world.

The Web Services and APIs World (REST and RESTful)
04:37
+
What You Have to Know About HTTP
6 Lectures 23:26

During this class you are going to see some specific details about HTTP:

  • How HTTP works
  • Some HTTP versions
  • The HTTP messages
  • What is a request
  • What is a response

Some further details

What is HTTP and How it Works
05:51

The GET method for HTTP is the most commonly used HTTP method. Every time that you visit a website, you are performing a GET request through your web browser.
In the HTTP protocol and the REST services, the GET method is used to obtain information about several resources or a specific resource. This method is only used to obtain resources, not to create, update or delete its.

The HTTP Method GET
02:55

The POST method for HTTP is the second most commonly used HTTP method. Every time that you end a form in a website, you are performing (probably) a POST request through your web browser.

In the HTTP protocol and the REST services, the POST method is used to create a new resource, normally only one specific resource instead of several. This method should be only used to create new instances for resources, not to show, update or delete its.

The HTTP Method POST
02:52

The PUT and PATCH methods for HTTP are a "special" type or methods. Those are "special" because the browsers do not support them natively. Normally to use these methods from the browser we need to use method spoofing sending a hidden field in the form, specifying the real method.

In the HTTP protocol and the REST services, the PUT and PATCH methods are used to update an existing resource. Those methods should be only used to update existing instances, not to show, create or delete its.

The HTTP Methods PUT and PATCH
03:47

The DELETE method for HTTP is a "special" type or method, like the PUT and PATCH, because the browsers do not support it natively. Normally to use this method from the browser we need to use method spoofing sending a hidden field in the form, specifying the real method.

In the HTTP protocol and the REST services, the DELETE method is used to delete an existing resource. This method should be only used to remove an existing instance, not to show, create or update its.

The HTTP Method DELETE
02:49

HTTP, being a protocol, defines a series of codes to follow and use, in specific cases, to communicate the result of an operation or HTTP request.

There exist several codes (some of these more used than others) that allow reporting if an operation went OK or if something went wrong.

The HTTP Status/Response Codes
05:12
+
Establishing the Development Environment
4 Lectures 10:44

XAMPP is a very useful tool for managing multiple services in one place. Services like Apache, PHP, and MySQL, can be easily managed from this tool.

One of the great facilities XAMPP is that it can be used on multiple operating systems, unlike other solutions such as WAMPP (windows), MAMPP (Mac) or LAMPP (Linux).

Downloading and Installing XAMPP
03:56

Composer, is an essential tool, for any project developed with PHP.

Through composer, you can easily access packages and open source projects that provide highly advanced features to a project.

Additionally, helps to easily manage the dependencies and self-generating scripts (autoload) for a functional code.

Downloading and Installing Composer
02:55

Sublime Text 3, is a code editor (different from an IDE) for building code in multiple languages in a very agile and effective way. It supports multiple operating systems and, in the case of Windows, includes a portable version.

Sublime Text has a huge community that develops many packages with different purposes, many of which facilitate code generation too.

Downloading and Installing Sublime Text 3
02:06

Postman is a generic, multipurpose client, which allow you to test and consume online services via HTTP, using several HTTP methods; through a very simple and intuitive user interface.

Installing Postman for Google Chrome
01:47
+
Setting the Development Environment
2 Lectures 09:08

A virtual host is a mechanism that facilitates the proper implementation and operation of a web project in the development environment. By having a virtual host in our system, we can easily emulate the operation of a real online application and avoid problems with the routes and the files, or to deliver our project to production

Creating a Virtual Host for Apache
04:02

The great power of Sublime is the huge amount of packages available that expand the functionality of the code editor and help to be much more effective and efficient during the development.

During this class, you are going to install some very popular and useful packages which will be used and required during the course. With those packages, the development and code generation is going to be easier.

Installing Some Advanced Packages for SublimeText3
05:06
+
Meet the API to Consume/Request
6 Lectures 23:35

Before to start with the development and implementation of the HTTP client, it is necessary to know in depth, the service to be consumed.

During this class, you are going to see some important details about this service and how to take advantage of it along the course.

Preview 02:54

The API to consume provides multiple functions that can be executed via the HTTP GET method.

During this class, you will see how the API responds to GET requests and all the different possibilities you have for it. With this API, you can make GET requests to:

  • Get the list of all student or a specific student
  • Obtain the list of all teachers or a specific teacher
  • Get the list of all courses or a specific course
  • Obtain all student of a course
  • Get all courses of a teacher
The GET Requests Over the API to Consume
04:12

During this class, you will see the procedure to be followed, in order to obtain a valid access_token from the API and then be able to perform advanced operations on the API.

Obtaining an access_token to Consume the API
03:29

The API to consume also provides several operations that can be performed using the HTTP POST method.

During this class, you will see how the API responds to the POST requests and all the different possibilities you have for it. With this API, you can make POST requests to:

  • Create a teacher
  • Create a student
  • I create a course, associated with a teacher
  • Add a student to a course
The POST Requests Over the API to Consume
06:06

Of course, the API also responds to requests with the PUT or PATCH methods. In this case, the API threads the PATCH and PUT requests in the same way. With this API, you can make requests for PUT or PATCH, for this:

  • Updating a student
  • Updating a teacher
  • Updating a course (may change associated with this teacher)
The PUT and PATCH Requests Over the API to Consume
03:19

Finally, the API also allows removing resources, through requests using the DELETE method.

During this class, you will see how the API responds to requests using the DELETE method. With this API, you can make DELETE requests for:

  • Remove a student
  • Remove a teacher
  • Delete a course, specifying the teacher dictates
  • Remove a student from a course (without removing the student)
The DELETE Requests Over the API to Consume
03:35
+
Installing and Implementing the Initial Structure of the HTTP Client
7 Lectures 21:51

Discover a very interesting way to resolve errors that you may face during the course and how to, effectively, use the source code of this project to improve your development and study experience.

Preview 00:59

With the tools installed correctly and with full knowledge of the service to consume, you can now proceed with the implementation of the client.

During this class, you will see how to obtain, through composer, the entire structure of Laravel framework to develop the client.

Obtaining the Laravel Structure for the HTTP Client
03:28

Normally on Linux and OSX, right after installation, you obtain a white screen, instead of the welcome message from Laravel.

To resolve this, you need to give permissions to some specific folders, so in that way, the framework can work properly.

Installing Laravel on Linux or Mac
00:42

Laravel is a comprehensive framework, so during this class, you are going to see its most important components, how some of these works and how to perform an initial configuration.

Configuring Laravel and The Project
03:25

GuzzleHTTP is a very powerful and popular project that facilitates the task of making requests through HTTP. Guzzle will be a very great utility for your HTTP client.

During this class, you will see how to add and install Guzzle as part of the Laravel project and to make use of it.

Preview 02:09

During this class, you will create the first components that make up the client development.

In this class, you are going to see how to create a layout, a view, and a route.

The layout will be containing the HTML structure that is common to all views (avoiding repeat the same code in every view).
The main view will use the layout and will have a list of links that will be growing up class-by-class, giving access to all the different functionalities of the client.
The route is going to return/show the main view when the user accesses the main URL (/).

Creating a Layout a View and a Route
05:17

In this class, you'll see how is simple to use GuzzleHttp to make requests to online services.

You are about to implement a function that allows requests to any location with any HTTP method and with any number of parameters. Furthermore, you will learn the best modular way, to use the client and make requests on HTTPS and not only on simple HTTP.

Preparing the Client to Perform Requests Over HTTP and HTTPS
05:51
+
Implementing the GET Operations of The Client Over The API
6 Lectures 29:59

It is time to implement the first client operation.

During this class, you are going to see how easily implement functionality that allows to consume the API using the GET methods and get the list of all students, then display it in a friendly way, to the user, using an HTML table.

Requesting the API to Obtain and Show all the Students in the HTTP Client
10:07

During this class, you'll see how easily implement a functionality that allows you to perform a GET request to the API and get the list of all courses.

The procedure is very similar to the previous class, however, you have to keep in mind that the attributes change and therefore views must adapt to this.

Requesting the API to Obtain and Show all the Courses in the HTTP Client
04:17

It is time to practice and demonstrate the knowledge acquired during previous classes.

You have seen how it comes to display the list of all students and courses, so now, put hands to work and implements the functions and components necessary to display the list of all teachers.

[Exercise] Requesting the API to Obtain and Show all the Teachers in The Client
01:03

It is the turn of GET requests, but passing values in the URL. In this case, for a specific instance, should be sent the student id.

During this class, you'll see how to implement functionality to send a GET request sending the id of the student, entered by the user and then get the instance of the student.

Requesting the API to Obtain and Show a Specific Student in the HTTP Client
09:08

Let's do the same as in the previous class, but now to obtain a specific instance of a teacher.

During this class, you'll see how to implement functionality to send a GET request sending the id of the teacher, entered by the user and then get the instance of that teacher.

Requesting the API to Obtain and Show a Specific Teacher in the HTTP Client
04:15

Let's now put things a little further and put into practice what has been.

Again, you've seen how to proceed to obtain and display a teacher and a student from a given id, so now, your task will be to implement the functions and components required to show a course from a given id.

[Exercise] Requesting the API to Obtain and Show a Specific Course in the Client
01:09
+
Implementing the POST Operations of The Client Over The API
4 Lectures 19:20

The API that is being consumed requires a valid access_token every time it receives requests for any HTTP method, different than GET.

During this class, you are going to see how to implement a simple mechanism to obtain a valid access_token, which can be used to perform advanced requests through POST, PUT / PATCH, and DELETE.

Implementing The Feature to Obtain an Access Token
06:34

In order to be very modular, we are going to implement a function that automatically obtains a valid access_token using the function implemented in the previous class and add that access_token to the Authorization header for the request.

In that way, you can use this function every time that you need to make a request that needs an access_token.

Preparing the Client to Perform Authorized Requests
03:57

Once it is possible to obtain easily an access_token, you can proceed with more complex requests.

During this class, you are going to see how to perform a POST request to the API to create a new student, from data entered by the user.

Creating Students in The API Through The HTTP Client
07:31

Now that you have seen how a student is created, and all the necessary components, sure you are going to get the same in the case of a teacher.

This exercise requests that you implement everything required to create a teacher in the API, from the client.

[Exercise] Creating Teachers in The API Through The HTTP Client
01:18
+
Implementing the PUT and PATCH Operations of The Client Over The API
2 Lectures 11:53

This class can be understood as the knot of the course. This class requires all you has learned during the previous classes.

To edit a resource, you must first get the list of all available resources to edit, and that the user chooses one. From the resource chosen, you should get the details of it to show it to the user and then make the updating stuff.

Updating a Student in The API Through The HTTP Client
10:16

It is time to solve your own knot of history. For this exercise, you require that the client allows a user to update the information of a selected teacher.

[Exercise] Updating a Teacher in The API Through The HTTP Client
01:37
+
Implementing the DELETE Operations of The Client Over The API
2 Lectures 08:27

During this class, you are going to see how to remove a teacher from the API, via HTTP DELETE requests.

This class has an important detail that is necessary to emphasize; that is, a teacher can not be removed if already have associated courses.

Removing a Teacher in The API Through The HTTP Client
06:46

You already know what to do :P It is going to be very similar to the process of remove a teacher. In fact, you do not have any kind of restriction.

[Exercise] Removing a Student in The API Through The HTTP Client
01:41
3 More Sections
About the Instructor
JuanD MeGon
4.4 Average rating
1,396 Reviews
6,359 Students
12 Courses
Engineer, Web Developer & Premium Instructor

I enjoy transmitting knowledge and skills to the people through classes and contents. Then, see how they build their projects and tools using the concepts learned.

Continually work on improving my speech, looking for the best way to reach out the students with the central concepts and skills, I love easy but effective ways to transmit every single idea.

I appreciate every minute developing, especially when I can use my skills to implement projects that can help other developers to learn or to make their job and lives easier.

I am constantly looking to work in new projects to leverage my skills and improving the lives of people with more facilities to share the experiences and findings with my students then.

I am excited to contribute to a better world teaching people new skills and, in the way, learn through the experiences and issues of them to improve our skills together.