Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a POST body in VBA

Tags:

vba

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 tied to using that object for making the HTTP request either.

like image 685
Moses Ting Avatar asked May 05 '10 13:05

Moses Ting


1 Answers

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
like image 62
Alex K. Avatar answered Sep 23 '22 14:09

Alex K.