Python 'request' contains errors and does not match my settings

The ‘Published’ Python sample code contains errors with default settings. Additionally, when I edited my Python Request settings to correct the updated values were not carried into the new Publication.

The first issue is that my users reported errors while using the sample Python Request code snippets. They found the following:

import requests
url = ''
payload = "{\n\t\"username\": \"{{SA_api_username}}\",\n\t\"password\": \"{{SA_api_password}}\"\n}"
headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
response = requests.request('POST', url, headers = headers, data = payload, allow_redirects=False, timeout=undefined, allow_redirects=false)
  • “Allow_redirects=False” is in the request function twice, so it returns a “Keyword argument repeated” error -> fixed if only one of it is there; delete the one at the end
  • “timeout=undefined” I couldn’t find “undefined” as a valid preset input anywhere online, so it looks like it’s trying to find “undefined” as a variable -> “None” is a valid input for the timeout keyword if we want to use that as a sample

The second issue is when alerted to this I customized the configuration in the documentation to set the timeout values and to turn-off redirect. Which resulted in the following:

import requests 

url = "https://{{SA_api_hostname}}/{{SA_api_env}}/update/persons" 
payload = {} 
headers = { 'authorizationToken': '{{SA_AuthenticationToken}}', 'x-api-key': '{{SA_api-key}}' 
response = requests.request("GET", url, headers=headers, data = payload, allow_redirects = False, timeout=1000) 

When I unpublished and RE-published the API the new values did not show up in the publication.

You can view for yourself here ->

Thank you in advance for any assistance with this. We love using Postman to communication with our clients on the latest updates with solid examples.


Hi @DanKRose and welcome here! :smiley:

Which version of Postman are you using? I’m on 7.12.0 and couldn’t reproduce that. This was a known bug in previous versions but has been fixed since I believe.


Thank you for looking at my request. Funny (not really funny) thing just happened when I opened Postman to check the version.

I received a message, bottom right of screen, that my version has been updated to 7.12.0. So that would seem like a good sign if what your suggesting as an old bug was the root of my issue.

Bad thing though is that it appears my environment has LOST the updates I’ve done to the my API completely post Sept 2019. So basically, all of my work has been lost. I’ve been working on this for the past few months and several versions of the api documented and released.

The published version, V2, is still published but the source code is no longer present in my Team Workspace. Any thoughts?


Hi Dan,

Sorry to hear about the loss of your recent updates. Would you please navigate to the links below and confirm if you find your updated data or not: - Environments - Personal collection - Team collection - All collections

Hello, Francis.

Thank you for the quick review.
Environments = All instances listed however the value for the variables are all empty. I suspect this is expected but as an fyi if that means anything to you.
My Collections = All instances are listed.
Team Collections = All instances (I’m the primary dev so most are the same).
All Collections = All are listed.

So they exist in the cloud but how would I link them back into my locally installed Postman app?

Thanks in advance for your attention to this.


Could you open a support ticket using the Submit a Ticket button on that page?

The support team should hopefully be able to walk you through recovering your data on your local instance. :slight_smile: