Bonjour,
J'aurais voulu savoir si vous avez deux minutes
pourquoi quand je fais mon post en initialisant idHTTP avec un proxy comme ci-dessous ca ne marche pas ?
Je ne comprend trop l'initialisation du proxy, il ne me manque rien? si?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 ... //Initialisation idHTTP1 := TIdHTTP.Create(nil); with IdHTTP1 do begin Name := 'IdHTTP1'; AllowCookies := True; ProxyParams.Create(); ProxyParams.BasicAuthentication := true; ProxyParams.ProxyPort := _portProxy; ProxyParams.ProxyServer := _addrProxy; ProxyParams.ProxyUsername := _idUserProxy; ProxyParams.ProxyPassword := _mdpProxy; Request.ContentLength := -1; Request.ContentRangeEnd := 0; Request.ContentRangeStart := 0; Request.Accept := 'text/html, */*'; Request.BasicAuthentication := False; Request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)'; HTTPOptions := [hoForceEncodeParams]; end; ... //Post d'un fichier MultiPartFormDataStream.AddFormField('nom',monNom); MultiPartFormDataStream.AddObject('file','multipart/form-data',monFile, 'nomFile'); IdHTTP1.Post(AddrHost+'/upload.php', MultiPartFormDataStream);
merci![]()
Partager