[Python] Curl Cifi python header cookie order

Discussão em 'Python' iniciado por Stack, Maio 24, 2025.

  1. Stack

    Stack Membro Participativo

    Im using Curl Cifi and Im wondering how I set custom header order (I want header order to follow setup in the header map below), also its not clear from the docs how to set the cookies in a certain position in the headers. For other TLS clients I can just specify the position of the cookies inside of the header order map, how can I do this for curl cifi? I want the cookies to be 2nd to last.

    headers = {
    "content-length": "0",
    "sec-ch-ua-platform": '"Windows"',
    "user-agent": self.userAgent,
    "accept": "application/json",
    "sec-ch-ua": self.secChUa,
    "content-type": "text/plain",
    "sec-ch-ua-mobile": "?0",
    "origin": "https://...",
    "sec-fetch-site": "same-site",
    "sec-fetch-mode": "cors",
    "sec-fetch-dest": "empty",
    "referer": "https://.../",
    "accept-encoding": "gzip, deflate, br, zstd",
    "accept-language": "en-US,en;q=0.9",
    "cookie": "", // Cookie goes here
    "priority": "u=0, I"
    }

    response = self.session.post(
    endpoint,
    headers=headers
    )

    Continue reading...

Compartilhe esta Página