Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access the response from a web site
Message
 
À
16/02/2006 14:24:54
Pamela Bulmahn
The University of Iowa
Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01096847
Message ID:
01096887
Vues:
20
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), "")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform