'How can I make request for an API?
I'm trying to make request for API: https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v2 but I haven't ideas for this. My code gives me next ouput: Response <400> How can I fix it?
My code:
import requests
import json
headers = {'content-type': 'application/json'}
def uniswap():
url = "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2"
data = {
'pairs': [
"id",
"reserve" : {
"name",
"symbol"
}
]
}
r = requests.post(url, data=data, headers=headers)
print(r)
def main():
uniswap()
if __name__ == "__main__":
main()
Link for site:
https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v2
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
