Open rochecompaan opened 3 years ago
Added request config to HTTP data sources instead of the usual parameters
Using this request config works for queries from izinto aggregations
{
"url": "http://35.187.32.42:8086/query",
"params": {"database": "izinto_aggregations"},
"auth": {
"username": "upfrontsoftware",
"password": "keHZZEd3L8nkXJvK"
},
"headers": {"Content-type": "application/x-www-form-urlencoded", "Accept": "application/json", "Accept-Encoding": "gzip"}
}
Add HTTP as a new type of data source.
When "HTTP" is selected as "Type", allow the user to specify the request config in a text area using the Axios request config syntax: https://www.npmjs.com/package/axios#request-config
This would enable access to almost any HTTP based API.
On the server-side, map the args in the syntax to the parameters documents in the requests library: https://requests.readthedocs.io/en/latest/api/#main-interface.
It might not be possible to map all the Axios config options to Python's request library. We should try to at least map the ones that are most important for API access.
Have a look at the following APIs to make sure that your mapping covers the URL and auth syntax: