1

After searching through most of this website i cant seem to find any problems like mine !

What i have currently achieved is getting data from a webpage. That is only the start though.

I now want to reverse this role and be able to post data to a given webpage. So basically when a button is pressed, i need a piece of code that sends some given text to a webpage. This is the code i currently have but all it seems to do is read the data what is already on the webpage.

Dim Input, SourceURL
Input = Testing1        'Given text

SourceURL = "http://webpage.com"    
Set xml = CreateObject("msxml2.serverxmlhttp.6.0")
xml.open "PUT", SourceURL, False
xml.send
JoeTest2= xml.responsetext
Debug.Print JoeTest2       'Print to debug screen

All this seems to do is the same as my "GET" script ? If anyone could show me where i am going wrong, it would be extremely helpful :)

bfontaine
  • 18,169
  • 13
  • 73
  • 107
Joe Larkin
  • 11
  • 1
  • 2
    Well you would use POST to POST not PUT which is to PUT. The *data* you need to POST depends on the form on the page. See [How to perform an HTTP POST request in ASP](http://stackoverflow.com/questions/1463635/how-to-perform-an-http-post-request-in-asp) – Alex K. Apr 30 '15 at 15:12
  • as @Alex K. said you need to `POST`, so your code would look like `xml.open "POST", SourceURL, False xml.send "DataToPostHere"` – Pupa Rebbe Apr 30 '15 at 17:37

0 Answers0