2

I want to perform a hidden HTTP-GET request from MS-access, as simple as possible, without any extra libraries/components.

Just a simple declare all needed.

Has WinHttp left the building??

JMax
  • 26,109
  • 12
  • 69
  • 88
Teson
  • 6,644
  • 8
  • 46
  • 69
  • 1
    did you have a look at this thread: http://stackoverflow.com/questions/158633/how-can-i-send-an-http-post-request-to-a-server-from-excel-using-vba? – JMax Aug 31 '11 at 09:13

2 Answers2

6

Here is a great page about that.

iDevlop
  • 24,841
  • 11
  • 90
  • 149
3

Hope this helps

 Dim xhr As Object
 Dim webServiceURL As String
 Dim actionType As String
 Dim thisRequest As String
 Dim targetWord As String

 WebServiceURL = "http://services.aonaware.com/DictService/DictService.asmx/"
 actionType = "Define?word="
 targetWord = "Marketplace"
 thisRequest = webServiceURL & actionType & targetWord

 'use late binding
 Set xhr = CreateObject("Microsoft.XMLHTTP")  

 xhr.Open "GET", thisRequest, False
 xhr.Send

 If xhr.status = 200 Then
   Debug.Print xhr.responseText
   MsgBox xhr.getAllResponseHeaders
 Else
   MsgBox xhr.status & ": " & xhr.statusText
 End If

 Set xhr = Nothing
Teson
  • 6,644
  • 8
  • 46
  • 69
Adarsh Madrecha
  • 6,364
  • 11
  • 69
  • 117