[Python] Add params to given URL in Python

Discussão em 'Python' iniciado por Stack, Fevereiro 12, 2025.

  1. Stack

    Stack Membro Participativo

    Suppose I was given a URL.
    It might already have GET parameters (e.g. http://example.com/search?q=question) or it might not (e.g. http://example.com/).

    And now I need to add some parameters to it like {'lang':'en','tag':'python'}. In the first case I'm going to have http://example.com/search?q=question&lang=en&tag=python and in the second — http://example.com/search?lang=en&tag=python.

    Is there any standard way to do this?

    Continue reading...

Compartilhe esta Página