views:

64

answers:

1

I am trying to figure out how to make a POST in VBA. Ideally I'm looking for a simple working example that I can play with. This is what I have so far, but I'm not really sure what to do with it. Mostly what does the formdata look like.

Function WinHTTPPostRequest(URL, formdata, Boundary)
  Dim http 

  Set http = CreateObject("MSXML2.XMLHTTP")

  http.Open "POST", URL, False

  'Set Content-Type header'
  http.setRequestHeader "Content-Type", "multipart/form-data; boundary=" + Boundary

  'Send the form data To URL As POST binary request'
  http.send formdata

  'Get a result of the script which has received upload'
  WinHTTPPostRequest = http.responseText
End Function

Edit:

So I installed firebug so that I could get the object names for the "formdata" (see code). I would have thought formdata would look something like this "Form1=A&Form2=B". But it's still not working out. Any suggestions on how I should be doing this better?

Edit: So it seems there might be hidden fields that I need to send in my POST request.

A: 

http://www.motobit.com/tips/detpg_post-binary-data-url/

i am a girl
Ommit