Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using HTTP Post from within a VFP program?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00832258
Message ID:
00832360
Vues:
33
Hi Andrew,

Certainly I have to promote my own stuff -- Windows API at http://www.news2news.com/vfp?group=92

Though this time I want you to take a look at this way of sending POST HTTP requests:
LOCAL oHttp, cUrl, cRawData
cUrl = 'http://...'
cRawData = 'any raw data or leave it empty'
oHttp = CreateObject('MSXML2.ServerXMLHTTP')

WITH oHttp
	.Open('POST', cUrl, 0)
	.SetRequestHeader('myheader', 'any value')

	WAIT WINDOW NOWAIT 'Executing remote...'
	.Send(cRawData)
	WAIT CLEAR

	* obtaining a response header
	? .GetResponseHeader('RequestError')  && if such header exists

	? .StatusText
	? .GetAllResponseHeaders()
	
	DELETE FILE tmp.txt
	IF StrToFile(.ResponseText, 'tmp.txt') <> 0
		MODI FILE tmp.txt NOWAIT
	ENDIF
ENDWITH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform