Creating a POST body in VBA

后端 未结 1 1290
梦毁少年i
梦毁少年i 2020-12-18 06:27

Does anyone know how to construct a POST DATA body in VBA? I\'m trying to upload rather lengthy strings via a post call using the \"Microsoft.XMLHTTP\" object. I\'m not ti

相关标签:
1条回答
  • 2020-12-18 06:54

    How about

    Dim XMLHttp As Object: Set XMLHttp = CreateObject("Microsoft.XMLHTTP")
    XMLHttp.Open "POST", "http://www.lfkfklkf.com", False
    XMLHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    XMLHttp.send "q=ploppy&x=cake"
    Debug.print XMLHttp.responseText
    Set XMLHttp = Nothing
    
    0 讨论(0)
提交回复
热议问题