Pamela,
There are several ways to send HTTP Request from VFP:
- calling URLDownloadToCacheFile or URLDownloadToFile API -- for GET requests only
- using WinINet API library
- using WinHTTP API library
- using Winsock API library
- using MSXML2.ServerXMLHTTP class
- using Winsock OCX
- using third-party library or control, WestWind for example
With any of these ways you can send POST, GET or other types of HTTP Requests and receive a response from HTTP server.
The first one is especially "quick and dirty". No exactly dirty :) but really quick, requires minimal coding.
DECLARE INTEGER URLDownloadToCacheFile IN urlmon;
INTEGER lpUnkcaller, STRING szURL, STRING @szFileName,;
INTEGER dwBufLength, INTEGER dwReserved, INTEGER pBSC
cFilename = RemoteToLocal("http://www....")
FUNCTION RemoteToLocal(cRequest)
LOCAL nResult, cTargetFile
cTargetFile = Repli(Chr(0), 250)
WAIT WINDOW NOWAIT "Downloading remote file..."
nResult = URLDownloadToCacheFile(0, cRequest, @cTargetFile,;
Len(cTargetFile), 0,0)
WAIT CLEAR
RETURN STRTRAN(cTargetFile, Chr(0), "")