HTTP request from cbbatch on UNIX
While answering some questions about integrating Clarify with web apps, I got a follow-up question (off the list) asking about how to make an HTTP request from cbbatch on UNIX. He didn’t care about the response – the page actually is just a php script that triggers a process on the web server; nothing visual is shown.
Here’s my reply:
I would use curl to make the HTTP request. curl is a command line tool for transferring data with URL syntax. It’s available for Windows, Mac, and a boatload of flavors of UNIX. The curl website: http://curl.haxx.se/
I’ve used curl in a couple of previous posts.
From cbbatch, just shell out and use curl to make the HTTP request. Like this:
Sub test()
Dim shellCommand as String
Dim processId as Integer
Dim url as String
Dim curl as Stringcurl = "c:bincurl.exe"
url = "www.google.com"shellCommand = curl + space$(1) + url
processId = Shell (shellCommand, ebHide)
Debug.Print processId
End Sub
Easy breezy.