jeu. 18 février 2016, 12h26
OlivierH
atoutfox.public.association
Re: get http avec un proxy
j'ai un petit code simple, j'ai aussi une class vcx si tu as besoin de
fenêtre thermo
*=======================================================
* Telecharge ici le fichier : remplir la var m.cUrl
("
http://mondomain.fr/monfichier.jpg")
*=======================================================
m.nResponse = 0
m.bAsync = .F. && si True alors ajouter la methode WaitForResponse
m.cVerb = "GET"
m.oHTTP = Createobject("WinHTTP.WinHTTPRequest.5.1")
m.oHTTP.Open(m.cVerb,m.cURL, m.bAsync)
m.oHTTP.Send()
&&m.oHTTP.WaitForResponse() && obligatoire si async true
m.nResponse = m.oHTTP.Status
&&this.cStatusText = m.oHTTP.Statustext
&&this.cResponseText = m.oHTTP.ResponseText
&&this.cResponseHeaders = m.oHTTP.GetAllResponseHeaders()
&&Messagebox("REPONSE "+str(m.nResponse))
if m.nResponse==200
m.cFile = m.oHTTP.ResponseBody
Set SAFETY OFF
Strtofile(m.cFile,cFicLocal)
Set SAFETY ON
m.VAL_RETOUR = .T.
Else
m.VAL_RETOUR = .F.
EndIF
*=======================================================
Olivier
Le 18/02/2016 10:36, Jean-Michel Jaouen a écrit :
> Bonjour à tous,
>
> Je cherche un exemple de code pour récupérer un fichier depuis une adresse http quand un proxy est utilisé.
> merci d'avance de m'éclairer.
>
> Jean Michel.
>
>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000017309