我在浏览器中打开DevTools,可以看到需要的请求。
Request info
我的代码: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":{ </

本文介绍了如何使用Python3的requests库发送XMLHttpRequest请求,包括设置请求头、请求体和URL。作者遇到401未经授权的响应,并探讨了可能的问题所在,包括请求的正确性和URL的有效性。
最低0.47元/天 解锁文章

被折叠的 条评论
为什么被折叠?



