title: Sending values as parameters in HTTP GET using VBA request
body: <p>So I am trying to send a basic request to a new API I'm testing out with the following script:</p>
  
  <pre><code>Sub CalcDemo()
      TargetURL = "https://my-api-url.com"
      Set HTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1")
      HTTPReq.Open "GET", TargetURL, False
      HTTPReq.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  
      postData = "user=myUsername&amp;password=myPassword"
      HTTPReq.send (postData)
      MsgBox (HTTPReq.responseText)
  </code></pre>
  
  <p>End Sub</p>
  
  <p>But I'm getting the following error message: <code>HTTP Status 401 - user and password should be specified as parameters on the request</code>.  I was under the impression that the manner in which <code>postData</code> is being passed above meant they are sent as parameters, but I guess I am wrong.  How can I send a string of parameters?</p>