Send XMLHttpRequest and get response with Python3 and requests
<p>I'm trying to get response from this page <a href="https://www.docavenue.com/#!medecin:62210-avion/medecin-generaliste/degryse-gilles" rel="nofollow">https://www.docavenue.com/#!medecin:62210-avion/medecin-generaliste/degryse-gilles</a>.</p>

<p>I open DevTools in a browser and can see needed request.
<a href="http://i.stack.imgur.com/hH6r0.png" rel="nofollow">Request info</a></p>

<p>My code:</p>

<pre><code>import requests


url = 'https://www.docavenue.com/elastic/healthcaredirectory/_search'
data = {
    "from":0,
    "size":1,
    "min_score":0,
    "query":{
        "bool":{
            "must":[
                {
                    "constant_score":{
                        "query":{
                            "match_phrase_prefix":{
                                "fullName.simple":"degryse-gilles"
                            }
                        }
                    }
                },
                {
                    "constant_score":{
                        "query":{
                            "match_phrase":{
                                "specialties.simple":"medecin-generaliste"
                            }
                        }
                    }
                },
                {
                    "constant_score":{
                        "query":{
                            "prefix":{
                                "center.postalCode":"62"
                            }
                        }
                    }
                },
                {
                    "constant_score":{
                        "query":{
                            "match_phrase":{
                                "center.city.simple":"avion"
                            }
                        },
                        "boost":2
                    }
                }
            ],
            "should":[
                {
                    "constant_score":{
                        "query":{
                            "match":{
                                "hasFreeTimeslot":{
                                    "query": True
                                }
                            }
                        },
                        "boost":2
                    }
                },
                {
                    "constant_score":{
                        "query":{
                            "match":{
                                "clientdocAvenue":{
                                    "query": True
                                }
                            }
                        },
                        "boost":2
                    }
                },
                {
                    "constant_score":{
                        "query":{
                            "match":{
                                "clientLGC":{
                                    "query": True
                                }
                            }
                        },
                        "boost":1
                    }
                }
            ]
        }
    },
    "sort":[
        {
            "_score":{
                "order":"desc"
            }
        },
        {
            "lastName":{
                "order":"asc"
            }
        }
    ]
}

headers = {
            "Accept": "application/json",
            "Accept-Encoding": "gzip, deflate, br",
            "Accept-Language": "ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4",
            "Connection": "keep-alive",
            "Content-Length": "728",
            "Content-Type": "application/json",
            "Cookie": "_gat=1; JSESSIONID=JPFr3DTsiE1rnNEmhNY5Ol9BocGhcFyVB9eemlpH.pdocaveweb02; BIGipServerpool-docavenue.cegedim-hds.fr-HTTP=!hO0vdO0hmRrQramJN+2PyIgcsB0pDo0KvdtLHbw+ziI+VMjPVBak3GeHdKZdGj3xQave1qLd0YeSikI=; _ga=GA1.2.1911756472.1469016537",
            "digest": "AKI20tURnFW6tp8nmtRNZVcxYEk/TViAUG5hOErsI4I=",
            "Host": "www.docavenue.com",
            "Origin": "https//www.docavenue.com",
            "Referer": "https//www.docavenue.com/",
            "timestamp": "2016-07-25T04:48:58.504+0500",
            "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
            "X-HTTP-Method-Override": "POST"
            }

response = requests.post(url, data=data, headers=headers)
print(response)
</code></pre>

<p>I get Response [401].
What's wrong with my code?</p>

<ol>
<li>Is it right that I send the request to the url which notes in request info?</li>
<li>Are the headers right? Should I add another or delete some  of listed?</li>
<li>Is data that I send is correct?</li>
</ol>