👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.
How to make AJAX request from Python?

AJAX requests can be easily perfomed with the Requests library for Python. The following example make a simple echo request from Postman Echo:

from requests import Session
response = Session().post(
    url='https://postman-echo.com/post',    
    data={ 'foo1': "bar1", 'foo2': "bar2" }
)
print (response.text)

The expected response is a JSON string like:

{'args': {},
 'data': '',
 'files': {},
 'form': {'foo1': 'bar1',
          'foo2': 'bar2'},
 'headers': {'accept': '*/*',
...




More