0
Dim req As New MSXML2.XMLHTTP60
req.Open "POST", "https://somewebsite.com/vpc"
req.setRequestHeader "Content-Type", "text/plain"
req.setRequestHeader "Accept", "application/xml"
req.send "Code=12345&Amount=100&Account=user......."
Debug.Print req.responseText

I get Account was+not+present+in+the+request in responseText

Updated questions: What is the format or syntax where you can send POST NVP in VBA?

DNguyen
  • 7
  • 3

1 Answers1

0

Thanks Cyboashu, I looked at the header in postman, copy it and got it to worked in VBA. Here is code in case anyone is wondering

Dim req As New MSXML2.XMLHTTP60
req.Open "POST", "https://somewebsite.com/vpc"
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send "Code=12345&Amount=100&Account=user......."
Debug.Print req.responseText
DNguyen
  • 7
  • 3