Javascript 将卷曲转换为提取

Javascript 将卷曲转换为提取,javascript,fetch-api,Javascript,Fetch Api,我正在看api上的这个inflow文档(),我可以运行如下的curl: curl -G 'http://10.111.11.11:9050/query?db=sdp_metrics' --data-urlencode "q=select distinct(host) from jmx where time > now() - 180m" 我试图将该结构转换为reactjs中的fetch,但似乎无法使其工作。在react中,我有以下内容: return fetch('http://10.1

我正在看api上的这个inflow文档(),我可以运行如下的curl:

curl -G 'http://10.111.11.11:9050/query?db=sdp_metrics' --data-urlencode "q=select distinct(host) from jmx where time > now() - 180m"
我试图将该结构转换为reactjs中的fetch,但似乎无法使其工作。在react中,我有以下内容:

return fetch('http://10.111.11.11:9050/query?db=sdp_metrics&q=' + 'select distinct(host) from jmx where time > now() - 180m'
            ).then(infltest => { does stuff })
浏览器返回200,但我没有返回任何数据

试试看:

'http://10.111.11.11:9050/query?db=sdp_metrics&q=' 
  + encodeURIComponent('select distinct(host) from jmx where time > now() - 180m')
尝试:


如果我的回答不正确,您能否澄清这是GET还是POST请求?(b)如果我的回答不正确,你能澄清这是GET还是POST请求吗?(b)