Web API with VBA

Hello,
I try to use WEB API with VBA
My code is :
wq = CreateObject(“WinHttp.WinHttpRequest.5.1”)
wq.Open “GET”, strUrl, False
wq.SetRequestHeader “Accept”, "application/json
wq.SetCredentials “user”, “password”, 0
wq.SetRequestHeader “User-Agent”, “http_requester/0.1”
wq.SetRequestHeader “Content-Type”, “application/json”
wq.Send
wq.WaitForResponse
strResp = wq.ResponseText

With
strUrl = http://sonarqube:9000/web_api/api/measures/component?component=" & sComponentName & "&metricKeys=ncloc
sComponentName : name of my project in SonarQube

And in the variable strResp I have this data :
doctype html><html lang="en"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><link rel="apple-t

And not the value of the metric ncloc.

Can you help me ?

Thank.

Frédéric.

Nix web_api from the URL being used. So…

http://sonarqube:9000/api/measures/component?component=" & sComponentName & "&metricKeys=ncloc

Hello,
Thanks a lot.
It works now.
Frédéric.