Skip to content

About request.Session #7024

@Jsy0220

Description

@Jsy0220

Hi, I have a special scenarios that there is a process called A continuously produces data while a process called B post the data to a url, The following is a fragment of process B pseudocode:

with requests.Session as session:
  while True:
    data = queue.get()
    response = make_request(data, session)

The loop above is expected to continue even if an exception occurs, so the question is:
If something wrong causes session invalid, does it throw exceptions ? if so, how to handle it so the loop continues ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions