
Discover the Python requests library essentials and how to integrate third-party APIs into your app, with an intro to how requests and APIs work and practical examples.
See how requests enable data exchange between a client and server via urls, parameters, and headers. Learn about methods, status codes, and formats like json and form data.
Install the requests library for python 3.6, activate a virtual environment, and start by importing requests in your project file to explore what you can do with requests.
After installing and importing requests, review the documentation and learn three testing tools—request response, httpbin, and request bin—to inspect and test http requests against a fake api.
Send a simple get request with Python requests to a target URL, inspect headers and the absence of a response, and learn when to read a response from the service.
send a request to a base url and an endpoint, view the response, and convert json text into python dictionaries to access data such as a first name.
Learn how to send url parameters with python requests by using query strings and dictionary payloads, comparing direct url parameters with the payload approach using the params option.
Learn to send custom headers with Python requests, including a token for authentication via a headers dictionary, and understand how to use or test headers like the user agent.
Learn how to use the five common http request methods—get, post, delete, put, and patch—to retrieve, add, or modify information, and read api documentation for each use case.
Send json data with requests via the json parameter, using a name and job payload to the /api/users endpoint, post the request, and view the created id in the response.
Send form data using Python requests by creating a payload with name and location, posting it to a form endpoint, and inspecting the server’s form fields and headers.
Learn to send files with Python requests by building a files dictionary, opening the file in binary mode, and uploading as multipart form data with an explicit mime type.
Learn to save an image returned by a requests call by checking the content-type header, then writing the binary response to a file in chunks.
Learn to handle exceptions in Python requests by using raise for status for HTTPError on 4xx/5xx responses, catch connection errors with try/except, and prepare for timeouts shown later.
Set and test timeouts to prevent blocking requests from hanging, and handle connect and read timeout exceptions with try/except to print timed out messages.
Learn how to implement HTTP basic authentication with the requests library in Python by supplying a username and password via the auth parameter to access protected endpoints.
Learn to read Swagger api documentation and test endpoints using curl with real and example responses, including status codes and authentication, as shown with GitHub rest api.
Explore the rest countries API using Python requests: learn to read documentation, perform get requests, use endpoints like all and by name, filter fields, and handle API responses.
Learn to query the REST Countries API with Python requests by composing base URLs and endpoints, filtering with fields, and retrieving country names, subregions, capitals, and currencies.
Learn to build a Python app with requests that queries a country API and returns population, languages, or time zones based on user input.
Learn how to use the Twilio messaging API with pure requests, compare it to the Twilio SDK, and build a simple text message example while exploring API documentation.
Learn to send messages with Twilio using Python requests by building a post request, authenticating with HTTP basic auth, and handling response data.
Explore how the GitHub application programming interface uses OAuth authentication to act on behalf of a user, including raw requests and when to use a software development kit.
Register a GitHub application, configure local host URLs and an authorization callback, then set up a Flask app with client ID and secret to handle the authorize route.
Build a GitHub sign-in flow using a Flask app that redirects users to GitHub for authorization, passes the client ID, and captures the authorization code.
Obtain a GitHub access token by posting the code with your client ID and secret to the token URL, requesting JSON, and then use the token for API requests.
Use the access token to call the GitHub API by sending a get request to the repos endpoint, including the authorization header, and extract repository names for display.
In this course you will learn about how requests on the web work and how to connect to APIs using the Python library called Requests. It covers everything you need to know about sending requests and handling responses in Python.
Why requests? Third-party APIs are a great way to add cool functionality to your app, and if you know how to access and use APIs, then you can take advantage of them. This course will help you get to the point where you're comfortable with working with APIs.
Check out list of videos that add up to over three hours below.
Join the course today by clicking the "Enroll in Course" button. I'll see you inside.