Curso Python Requests Foundation

  • DevOps | CI | CD | Kubernetes | Web3

Curso Python Requests Foundation

08 Horas
Visão Geral

O curso Python Requests Foundation é uma introdução abrangente à biblioteca Requests, uma das mais populares para fazer requisições HTTP em Python. Durante o curso, os alunos aprenderão como realizar requisições web, interagir com APIs, e manipular respostas HTTP de forma prática e eficiente. O Requests simplifica o processo de comunicação com a web, permitindo que desenvolvedores criem e consumam APIs com facilidade. O curso é voltado tanto para iniciantes quanto para profissionais que desejam dominar a comunicação via HTTP em seus projetos Python.

O curso Python Requests Foundation fornecerá uma base sólida para os participantes que desejam interagir com a web, permitindo que façam requisições HTTP e consumam APIs com eficiência em Python, e lidem com respostas de maneira robusta e segura.

 

Objetivo

Após realizar este curso Python Requests Foundation, você será capaz de:

  1. Compreender o funcionamento básico do protocolo HTTP.
  2. Fazer requisições HTTP (GET, POST, PUT, DELETE) usando a biblioteca Requests.
  3. Interagir com APIs RESTful e manipular respostas JSON.
  4. Trabalhar com cabeçalhos HTTP, parâmetros de URL, e dados de formulário.
  5. Gerenciar sessões de autenticação e cookies.
  6. Lidar com erros e exceções em requisições HTTP.
Publico Alvo
  • Desenvolvedores Python que desejam interagir com APIs RESTful e enviar/receber dados pela web.
  • Engenheiros de software que necessitam integrar serviços externos ou manipular dados vindos de fontes externas em aplicações Python.
  • Administradores de sistemas que buscam automatizar tarefas relacionadas a serviços web.
  • Qualquer pessoa interessada em aprender a fazer requisições HTTP em Python.
Pre-Requisitos
  • Conhecimento básico de Python.
  • Familiaridade com conceitos de web, como HTTP, JSON, e APIs RESTful.
  • Noções básicas de como a internet e servidores web funcionam.
Materiais
Inglês + Exercícios + Lab Pratico
Conteúdo Programatico

Introduction to HTTP and Requests

  1. Overview of HTTP: Methods, status codes, headers, and body
  2. Why use the Requests library?
  3. Installing and setting up Python Requests
  4. First request: Making your first HTTP GET request

Making GET Requests

  1. Basic structure of a GET request
  2. Sending query parameters in a GET request
  3. Handling query strings and URLs dynamically
  4. Inspecting the response: Status codes, headers, and content

Making POST, PUT, DELETE Requests

  1. The difference between GET, POST, PUT, and DELETE
  2. Sending data via POST and PUT requests
  3. Uploading files in a POST request
  4. Sending JSON data in requests
  5. Deleting resources with a DELETE request

Handling HTTP Responses

  1. Understanding response status codes and their meanings
  2. Reading and parsing response content (JSON, XML, HTML)
  3. Handling binary responses (e.g., images, PDFs)
  4. Accessing response headers and metadata
  5. Extracting information from HTML with BeautifulSoup (optional integration)

Working with Headers and Authentication

  1. Adding custom headers to your requests
  2. Handling common HTTP authentication methods (Basic, Bearer tokens)
  3. Using API keys and tokens in requests
  4. Managing authentication with OAuth (brief introduction)

Handling Cookies and Sessions

  1. What are cookies and how they work in HTTP
  2. Managing cookies between requests
  3. Using the Session object in Requests for persistent sessions
  4. Making authenticated requests using sessions

Sending Data in Requests

  1. Sending form-encoded data (application/x-www-form-urlencoded)
  2. Sending multipart form data for file uploads
  3. Sending JSON payloads in requests
  4. URL encoding and decoding query parameters

Handling Timeouts, Redirects, and Errors

  1. Setting timeouts for HTTP requests
  2. Managing automatic redirects and how to control them
  3. Handling common exceptions in Requests (e.g., connection errors, timeouts)
  4. Retrying failed requests with backoff strategies

Advanced Requests Features

  1. Streaming large requests and responses
  2. Using proxies with Requests
  3. Handling SSL certificates and making secure requests
  4. Customizing the SSL/TLS behavior for secure connections
  5. Uploading files asynchronously with the aiohttp library (optional section)

Consuming APIs with Python Requests

  1. Introduction to REST APIs and how to interact with them
  2. Making GET and POST requests to public APIs
  3. Parsing and working with JSON responses
  4. Real-world example: Consuming a public API (e.g., GitHub, OpenWeatherMap)

Error Handling and Debugging Requests

  1. Catching and handling different HTTP exceptions
  2. Debugging requests using logging and verbose output
  3. Tools for inspecting HTTP requests (Postman, curl)
  4. Best practices for error handling in web requests

Practical Projects

  1. Building a Python script that interacts with a public API
  2. Automating a web-based task using Python Requests
  3. Implementing a simple web scraper with Requests and BeautifulSoup (optional)

Final Project: Building an API Consumer in Python

  1. Designing a Python application to consume and process data from multiple APIs
  2. Implementing error handling, logging, and retry mechanisms
  3. Parsing and saving API responses into a local database (optional)
  4. Deploying the script as an automated task or cron job
TENHO INTERESSE

Cursos Relacionados

Curso Ansible Red Hat Basics Automation Technical Foundation

16 horas

Curso Terraform Deploying to Oracle Cloud Infrastructure

24 Horas

Curso Ansible Linux Automation with Ansible

24 horas

Ansible Overview of Ansible architecture

16h

Advanced Automation: Ansible Best Practices

32h