Код, предоставляющий HTML в качестве вывода вместо JSON ⇐ Python
-
Anonymous
Код, предоставляющий HTML в качестве вывода вместо JSON
I have Python code where I am connecting to "metadata/graphiql" from Tableau Online and then writing a "query". The result should be in JSON format but I'm getting some HTML code instead.
import requests graphql_url = "https:///metadata/graphiql" metadata_query=''' query { workbooks{ name } }''' response=requests.post(graphql_url, json={'query':metadata_query}) print(response.content) if response.status_code==200: print(response.json()) else: print('Error:',response.text) I am expecting a JSON output of the metadata_query.
Источник: https://stackoverflow.com/questions/781 ... ad-of-json
I have Python code where I am connecting to "metadata/graphiql" from Tableau Online and then writing a "query". The result should be in JSON format but I'm getting some HTML code instead.
import requests graphql_url = "https:///metadata/graphiql" metadata_query=''' query { workbooks{ name } }''' response=requests.post(graphql_url, json={'query':metadata_query}) print(response.content) if response.status_code==200: print(response.json()) else: print('Error:',response.text) I am expecting a JSON output of the metadata_query.
Источник: https://stackoverflow.com/questions/781 ... ad-of-json