HTTP Connector
Configure direct HTTP sources and destinations for Beam transfers.
HTTP transfers use the SDK's plain SourceConfig / DestConfig models. They are useful when the source and destination are already exposed through HTTPS URLs. There is no object to read a size from, so you supply the total size yourself.
Python SDK
import asyncio
import os
from beam_network_sdk import BeamSDK
from beam_network_sdk.models import DestConfig, SourceConfig
async def main() -> None:
async with BeamSDK(api_key=os.environ["BEAM_API_KEY"]) as beam:
transfer = await beam.transfers.create_and_distribute(
sources=[
SourceConfig(
type="http",
url="https://downloads.example.com/dataset.bin",
headers={"Authorization": "Bearer SOURCE_TOKEN"},
)
],
destinations=[
DestConfig(
type="http",
url="https://uploads.example.com/ingest/dataset.bin",
headers={"Authorization": "Bearer DEST_TOKEN"},
)
],
total_size=104857600,
name="http-to-http",
)
status = await beam.transfers.wait_complete(transfer.transfer_id, timeout=3600)
print(status.status)
asyncio.run(main())create_and_distribute creates the transfer and hands it to the network in one call. In TypeScript, beam.createAndDistribute({ sources, destinations, totalSize }) takes the same configs.
Worker Requirements
Workers run on independent operators' hosts, so both URLs must be reachable from the internet. Workers receive the URLs and the headers you set, so use short-lived tokens scoped to these objects rather than long-lived credentials.
For efficient parallel transfers, HTTP sources should support byte ranges:
Accept-Ranges: bytes