Notes - MIECT
Computação Distribuída
Notes - MIECT
Computação Distribuída
  • Computação Distribuída
  • Introduction / Architecture
    • Distributed Systems
    • Architecture
    • Middleware Organizations
    • Processes
    • Threads
    • Virtualization
    • Clients
    • Servers
    • Migration
  • Communications
    • OSI Model
    • Middleware Layer
    • Types of Communication
    • Remote Call Procedure (RPC)
    • Sockets
    • Application-level Multicasting
  • Naming
    • Names
    • Addresses
    • Identifiers
    • Naming Systems
      • Flat Naming
      • Structured Naming
    • Internet Domain Name System (DNS)
    • Attribute-based naming - LDAP
  • Coordination
    • Clocks
      • Synchronizing without UTC
    • Reference Broadcast Synchronization – RBS
    • Happened-Before Relation
      • Logical Clocks
      • Vector Clocks
    • Mutual Exclusion Algorithms
    • Election Algorithms
    • Distributed Events Correspondance
  • Consistency & Replication
    • Replication
    • Performance and Scalability
    • Client-centric models
    • Replicates
    • Unicasting vs. Multicasting
    • Continuous Consistency
    • Protocols
  • Flaw Tolerance
    • Dependability
    • Terminology
    • Confidence vs. Security
    • Halting failures
    • Redundancy to mask failures
    • Consensus
      • Realistic
      • Consensus in arbitrary failures
      • Achieving failure tolerance
      • Distributed consensus
    • Failure Detection
    • Reliable RPCs
    • Distributed commit protocols
  • Python asyncio & Friends
    • Async
    • Sync vs. Async
    • Tools
  • Flask
    • Introduction
    • Python Requests
  • Containers
    • VM's vs Containers
    • OS Support
    • Building a container
    • Tools
    • Portability
    • Docker
      • Container
  • Map Reduce
    • Map Recude
    • Hadoop
    • Software Architecture
    • Task Scheduling
    • Comparison With Traditional Models
  • Cloud Computing
    • Cloud Computing
    • IaaS – Infrastructure as a Service
    • PaaS – Platform as a Service
    • SaaS – Software as a Service
    • Business Models
Powered by GitBook
On this page
  • GET
  • POST
  • POST of a file
  1. Flask

Python Requests

High-level library to interact with HTTP servers.

Based on the library urllib3.

Why use?

  • Keep-Alive and connection pooling.

  • Sessions with cookie persistence.

  • Digest/Basic authentication.

  • File upload using Multipart.

GET

import requests

if __name__ == "__main__":
    r = requests.get("https://www.ua.pt/manifest.json")
    print(r.text)

Or better.

if __name__ == "__main__":
    r = requests.get("https://www.ua.pt/manifest.json")
    data = r.json()
    print(data["name"])

POST

if __name__ == "__main__":
    url = "https://httpbin.org/post"
    payload = {"name": "Diogo"}
    response = requests.post(url, json = payload)
    print(response.text)

POST of a file

if __name__ == "__main__":
    url = "https://httpbin.org/post"
    files = {'file': open('movie.mp4', 'rb')}

    r = requests.post(url, files=files)
    print(r.text)
PreviousIntroductionNextVM's vs Containers

Last updated 2 years ago