{"library":"paypalhttp","title":"PayPal HTTP Client","description":"paypalhttp is a lightweight, low-level HTTP client library developed by PayPal, designed to wrap API calls to REST APIs. It provides basic HTTP request and response serialization capabilities (JSON, multipart, form-encoded, text). The current stable version is 1.0.1, and it maintains a stable release cadence as a foundational utility for higher-level PayPal SDKs.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install paypalhttp"],"cli":null},"imports":["from paypalhttp.http_client import HttpClient","from paypalhttp.requests import GetRequest","from paypalhttp.serializers import JsonSerializer"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom paypalhttp.http_client import HttpClient\nfrom paypalhttp.requests import GetRequest\nfrom paypalhttp.serializers import JsonSerializer\n\n# Define a custom client that uses a base URL\nclass MyGenericApiClient(HttpClient):\n    def __init__(self):\n        # paypalhttp is a low-level client; it doesn't handle authentication\n        # or full API paths directly. It expects a base URL and relative paths.\n        # In real PayPal SDKs, this would be 'https://api.sandbox.paypal.com'\n        # or 'https://api.paypal.com'. Using httpbin.org for a runnable example.\n        super().__init__('https://httpbin.org')\n\n# Instantiate the custom client\nclient = MyGenericApiClient()\n\n# Create a GET request to a test endpoint\nrequest = GetRequest('/get') # This will hit https://httpbin.org/get\n\n# You can add headers, parameters, or a body (with a serializer)\nrequest.headers['User-Agent'] = 'PayPalHttp-Client-Example'\n\nprint(f\"Making request to: {client.environment_url}{request.path}\")\n\ntry:\n    # Execute the request\n    response = client.execute(request)\n\n    print(f\"\\nStatus Code: {response.status_code}\")\n    print(f\"Headers: {response.headers}\")\n    # The 'result' attribute contains the deserialized response body\n    # For httpbin.org/get, this is typically a JSON object.\n    print(f\"Result (JSON): {response.result}\")\n\nexcept Exception as e:\n    print(f\"\\nError executing request: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to instantiate a basic `HttpClient`, define a GET request, and execute it against a public test API (`httpbin.org`). It highlights the low-level nature of `paypalhttp`, where you define the base URL and manage request details yourself. In a real PayPal integration, `paypalhttp.HttpClient` is typically subclassed to handle authentication and specific PayPal API base URLs.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"1.0.1","pypi_latest":"1.0.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":3.1,"avg_import_s":0.59,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.59,"mem_mb":9.8,"disk_size":"38.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.3,"import_time_s":0.4,"mem_mb":9.8,"disk_size":"39M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.71,"mem_mb":10.9,"disk_size":"41.1M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.1,"import_time_s":0.63,"mem_mb":10.9,"disk_size":"42M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.66,"mem_mb":11.3,"disk_size":"32.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.7,"import_time_s":0.68,"mem_mb":11.3,"disk_size":"33M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.64,"mem_mb":11.7,"disk_size":"32.2M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.7,"import_time_s":0.63,"mem_mb":11.7,"disk_size":"33M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.52,"mem_mb":9.4,"disk_size":"38.4M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"paypalhttp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3.8,"import_time_s":0.47,"mem_mb":9.4,"disk_size":"39M"}]}}