Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access the response from a web site
Message
 
To
16/02/2006 14:24:54
Pamela Bulmahn
The University of Iowa
Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01096847
Message ID:
01096887
Views:
21
This message has been marked as the solution to the initial question of the thread.
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....")
* open and parse cFilename

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), "")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform