Skip to main content

serialize_pairs

No overview available.

def serialize_pairs(
pairs: iterable
) - > string

Converts a collection of key-value pairs into a URL-encoded query string format. Use this to prepare data for inclusion in a URI or for application/x-www-form-urlencoded request bodies.

Parameters

NameTypeDescription
pairsiterableA collection of tuples or a dictionary containing the key-value pairs to be serialized.

Returns

TypeDescription
stringA URL-encoded string of key-value pairs joined by ampersands, or an empty string if no pairs are provided.