【发布时间】:2020-10-01 07:13:48
【问题描述】:
我正在尝试使用 Python 语言检测 graphql 端点。我是一个绝对的初学者,但我尝试过编写代码。 你能建议改变和更好的方法吗? 代码:
import requests,urllib,urllib.request
import string
consoleDict = [
"",
"/graphql",
"/graphql/console",
"graphql.php",
"graphiql",
"explorer",
"altair",
"/playground"
]
for endpoint in consoleDict:
ep = ' http://159.100.248.211 '
response = requests.get(ep)
if response.status_code in [200,403]:
print("It is a GraphQL endpoint",endpoint)
谢谢你:)
【问题讨论】:
-
您可能想要使用 graphql 客户端库,例如 gql
-
嘿,你能告诉我怎么做吗,也许可以帮我写代码。我绝对是初学者,所以:3
-
您根本没有使用
endpoint变量。然后你总是向同一个主机 http:159.100.248.211 发出请求。
标签: python python-requests graphql endpoint graphql-python