Starting with Requests version 2.4.2, you can use the json= parameter (which takes a dictionary) instead of data= (which takes a string) in the call:

>>> import requests
>>> r = requests.post('http://httpbin.org/post', json={"key": "value"})
>>> r.status_code
200
>>> r.json()
{'args': {},
 'data': '{"key": "value"}',
 'files': {},
 'form': {},
 'headers': {'Accept': '*/*',
             'Accept-Encoding': 'gzip, deflate',
             'Connection': 'close',
             'Content-Length': '16',
             'Content-Type': 'application/json',
             'Host': 'httpbin.org',
             'User-Agent': 'python-requests/2.4.3 CPython/3.4.0',
             'X-Request-Id': 'xx-xx-xx'},
 'json': {'key': 'value'},
 'origin': 'x.x.x.x',
 'url': 'http://httpbin.org/post'}
Answer from Zeyang Lin on Stack Overflow
🌐
W3Schools
w3schools.com › python › ref_requests_post.asp
Python Requests post Method
A requests.Response object. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
Discussions

[Python] How to parse JSon response from a post request (Requests)
If I run your code I get NameError on session, maybe you need to define that for it to work? More on reddit.com
🌐 r/learnprogramming
9
2
March 2, 2017
How to POST JSON with data payload and header with Python Requests? - Stack Overflow
I am trying to do some scraping from websites using GET and POST methods, but now I am facing a new challenge. I am trying to get data from a credit simulator, I found this portuguese site (https:/... More on stackoverflow.com
🌐 stackoverflow.com
Why is the json information not loading in from the request ?
I was able to connect successfully to the website. However when I use .json function why am I getting an error. Is it because I have to actually… More on reddit.com
🌐 r/learnpython
9
2
October 9, 2023
APIs: Params= vs json= whats the difference?
Maybe it's a good idea to study the basics of HTTP methods: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods A GET request has no body, so the only (practical) way of delivering data with it is through its url, so GET hostname/api/some_object/?name='test' The requestst library supports that via its params= parameter. So in this case you would do params={'name': 'test'}. Then methods like PUT and POST are meant to deliver data through their body, for which you would normally use the data= parameter. However to simplify delivering a Python structure (dict/list or some combination thereof) as a JSON encoded body, it supports that via its json= parameter. It then also sets the correct content-type header. More on reddit.com
🌐 r/learnpython
4
2
November 26, 2021
People also ask

What is the difference between data and json parameters in Python requests?

data is for form-encoded (default) or raw data (when Content-Type header is overriden). While json is specifically for JSON format data and automatically sets Content-Type to application/json.

🌐
scrapfly.io
scrapfly.io › blog › posts › how-to-python-requests-post
Guide to Python requests POST method
Does the Python requests library support asynchronous POST requests?

Unfortunately, the requests library does not support asynchronous requests. However, the httpx library is an alternative that provides async capabilities, making it suitable for applications requiring concurrency.

🌐
scrapfly.io
scrapfly.io › blog › posts › how-to-python-requests-post
Guide to Python requests POST method
How can I include custom headers in using Python requests?

Pass headers as a dictionary using the headers parameter. Note that requests automatically generates some headers like User-Agent, Content-Length and Content-Type, so be cautious when overriding them.

🌐
scrapfly.io
scrapfly.io › blog › posts › how-to-python-requests-post
Guide to Python requests POST method
🌐
Requests
requests.readthedocs.io › en › latest › user › quickstart
Quickstart — Requests 2.33.0.dev1 documentation
Note, the json parameter is ignored if either data or files is passed. Requests makes it simple to upload Multipart-encoded files: >>> url = 'https://httpbin.org/post' >>> files = {'file': open('report.xls', 'rb')} >>> r = requests.post(url, files=files) >>> r.text { ...
🌐
ReqBin
reqbin.com › code › python › m2g4va4a › python-requests-post-json-example
How do I post JSON using the Python Requests Library?
To post a JSON to the server using Python Requests Library, call the requests.post() method and pass the target URL as the first parameter and the JSON data with the json= parameter.
🌐
Apify
blog.apify.com › python-post-request
How to post JSON data with Python Requests
December 7, 2025 - The Python Requests library is widely used for making HTTP requests. Here are some tips for making effective POST requests: Sending JSON data: The best way to send JSON data is to use the json parameter of the requests.post() function.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › response-json-python-requests
response.json() - Python requests - GeeksforGeeks
July 12, 2025 - To print the JSON data fetched we have used json() method which prints the JSON data in the Python dictionary format as seen in the output. In this way, we can pas parse JSON responses in Python. ... # import requests module import requests # Making a get request response = requests.get('https://api.github.com///') # print response print(response) # print json content print(response.json())
🌐
Scrapfly
scrapfly.io › blog › posts › how-to-python-requests-post
Guide to Python requests POST method
September 26, 2025 - The requests.post() function is your primary tool for sending POST requests in Python. It allows for customizable and straightforward data sending by specifying the URL, headers, and the data itself.
🌐
Codemia
codemia.io › knowledge-hub › path › how_to_post_json_data_with_python_requests
How to POST JSON data with Python Requests?
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
🌐
Apidog
apidog.com › blog › python-requests-post-json
Python Requests: How to POST JSON Data with Ease in 2026
February 4, 2026 - Step 2: Click on the Request tab and select POST from the dropdown menu. Step 3: Enter the URL of the API endpoint you want to test, in the Headers section, add any required headers.
🌐
Real Python
realpython.com › python-requests
Python's Requests Library (Guide) – Real Python
July 23, 2025 - To add headers to requests, pass a dictionary of headers to the headers parameter in your request. To send POST data, use the data parameter for form-encoded data or the json parameter for JSON data.
🌐
Medium
techkamar.medium.com › sending-form-data-post-using-python-requests-library-55850c7a93d5
Sending FORM data POST using Python Requests library - tech kamar - Medium
June 26, 2024 - Recently, I had a problem where i had to send FORM data to an API instead of JSON. My backend server is hosted at http://localhost:8080 · http://localhost:8080/login is the end point I want to hit with username and password as form data. ... import requests url = "http://localhost:8080/login" form_data = {"username":"johndoe", "password": "user@1234"} resp = requests.post(url, data=form_data)
🌐
W3docs
w3docs.com › python
How to POST JSON data with Python Requests?
response = requests.post('https://httpbin.org/post', json=data)
🌐
ScrapeOps
scrapeops.io › home › python web scraping playbook › python requests post requests
Python Requests - How to Send POST Requests | ScrapeOps
April 12, 2023 - Doing this with Python requests is very simple. We simply just need to add the data to the request using the json parameter of the POST request:
🌐
Stack Abuse
stackabuse.com › how-to-post-json-data-using-requests-library-in-python
How to POST JSON Data Using requests Library in Python
June 27, 2023 - Now, we can jump into the meat ... JSON data in the body of the request. We first need to import the requests library, specify the URL that we want to send the request to and define the JSON data in the data variable....
🌐
Claudia Kuenzler
claudiokuenzler.com › blog › 1180 › how-to-send-http-requests-python-authentication-json-post-data
How to send HTTP requests in Python, handle authentication and JSON POST data
February 15, 2022 - In Python requests, the data payload can be defined in various ways. The default is to simply define the payload in a data parameter: >>> r=requests.post('http://api.example.com/rpc', data=somedata) But as we are sending a JSON payload, there is a special parameter for JSON:
🌐
ProxiesAPI
proxiesapi.com › articles › sending-and-receiving-json-data-with-python-requests
Sending and Receiving JSON Data with Python Requests | ProxiesAPI
import requests data = { 'name': 'John Doe', 'age': 30 } response = requests.post('https://api.example.com/users', json=data) No need to encode to JSON yourself! This makes working with web APIs that accept JSON very straightforward. Many modern web APIs return JSON formatted responses. Requests will automatically decode the JSON response so you can access it as a Python dict or list:
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-requests-post-request-with-headers-and-body
Python requests - POST request with headers and body - GeeksforGeeks
July 23, 2025 - import requests url = "https://httpbin.org/post" data = { "id": 1001, "name": "geek", "passion": "coding", } response = requests.post(url, json=data) print("Status Code", response.status_code) print("JSON Response ", response.json()) Output: Example 2: Sending requests with JSON data and headers · Python ·
🌐
ReqBin
reqbin.com › code › python › rituxo3j › python-requests-json-example
How do I get JSON using the Python Requests?
To request JSON data from the server using the Python Requests library, call the request.get() method and pass the target URL as a first parameter. The Python Requests Library has a built-in JSON decoder and automatically converts JSON strings ...
Top answer
1 of 1
3

Looks like you need to expand the payload to include more (all) of the parameters (including the cookies, specifically the ASP.NET_SessionId).

import requests

import warnings
warnings.filterwarnings("ignore")

term=24
amount=5000

url = 'https://simuladores.bancomontepio.pt/ITSCredit.External/Calculator/ITSCredit.Calculator.UI.External/gateway/Calculator/api/Calculator/Calculate?hash=-1359629931'

headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36',
'Accept-Language': 'pt-PT,pt;q=0.9,en-US;q=0.8,en;q=0.7',
'Cookie':'ASP.NET_SessionId=fhkyn1vn5knlw3uhdnh50nii;'}


payload = {
    "CCRDCalculateInput":{},
    "MultifunctionsCalculateInput":{},
    "Device":{
        "Browser":"chrome",
        "BrowserVersion":"96.0.4664.110",
        "Device":"Desktop",
        "Os":"windows",
        "OsVersion":"windows-10",
        "UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"},
    "IsCustomer":'true',
    "Amount":amount,
    "Term":term,
    "ConditionCode":"26B1129900X-01-I-129900-F",
    "CreditDestinationCode":"129900",
    "ProductCode":"26B1129900X",
    "FinancedExpenses":'false',
    "FrequencyTrancheCode":'null',
    "GoalCode":"C006",
    "GoalDescription":"PROJETOS PESSOAIS",
    "FrequencyTypeCode":"M",
    "FamilyCode":"CP",
    "Proponents":[{
        "Position":'1',
        "Birthday":"1992-03-10T13:03:24.000Z",
        "State":'true',
        "EntityType":{
            "ID":'1',
            "CompanyID":'1',
            "Code":"P",
            "Description":"Proponente",
            "Value":'null',
            "ValueString":'null',
            "State":'true',
            "Imported":'null'},
        "ExpenseCodes":[
            "009"]}],
    "Counterparts":'0',
    "OptionalExpenses":[{
        "Code":"009",
        "Factor":'1'}],
    "ResidualValue":'0',
    "InterestOnly":'0',
    "Deferment":'0'}

jsonData = requests.post(url, headers=headers, json=payload, verify=False).json()
results = jsonData['Result']

mtic = results['MTIC']
installment = results['PeriodInstallment'][0]['Installment']
taeg = results['TAEG']
tan = results['PeriodInstallment'][0]['TAN']


print(f'Installment: {installment}\nTAEG: {taeg}\nTAN: {tan}\nMTIC: {mtic}')

Output:

Installment: 224.5
TAEG: 14.8
TAN: 7.0
MTIC: 5708.2