title: POST Parameters not passing to Web API using VBA
body: <p>I have a bog standard WebAPI that accepts a POST and takes those parameters and processes certain things. I'm not certain if the problem is the VBA or the ASP.Net WebAPI so I am cross posting.</p>
  
  <p>I've used Postman to test the API and it works fine when I post Key/Value params.</p>
  
  <p>I've also tried the following method and relevant parameters and get the same result:</p>
  
  <pre><code>Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
  </code></pre>
  
  <p>I'm having problems getting it to work with the VBA, when debugging in Visual Studio on the WebAPI I cannot see the values I am posting anywhere. It's like the request is coming in blank. My WebAPI is subsequently throwing an error because the parameters are missing and certain parameters are required.</p>
  
  <p>I'm not sure if this is a problem on the VBA side or the ASP.NET WebAPI side so I am cross posting in a hope someone can highlight or spot what I am doing wrong.</p>
  
  <pre><code>Private Sub Command4_Click()
  
  Dim argumentString1 As String
  
  argumentString1 = "companyId=228&amp;secondsToLog=15&amp;subject=TestBackup123&amp;description=TestDescription" &amp; _
  "&amp;category=&amp;tag=&amp;ticketType=task&amp;assignee=gavin&amp;requesterEmail=bob@smith.com" &amp; _
  "&amp;submitterName=gavin&amp;status=open&amp;priority=normal"
  
  Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
  URL = "http://localhost:64874/api/zendeskhelper"
  objHTTP.Open "POST", URL, False
  objHTTP.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
  objHTTP.send (argumentString1)
  
  
  txtresult = objHTTP.responsetext &amp; ": " &amp; argumentString1
  End Sub
  </code></pre>
  
  <p>The Web API structure looks like this:</p>
  
  <pre><code>public HttpResponseMessage Post([FromUri] TicketBody ticket)
  {
  // Nothing is bound to ticket like it is in Postman
  }
  </code></pre>
  
  <p>Any help or pointers would be much appreciated!</p>