Cannot post data

Giganews Newsgroups
Subject: Cannot post data
Posted by:  fer
Date: Mon, 15 Aug 2005

hi

i am trying to connect to a server but there is a trick i can't solve.

i trace the explorer 's post it is like this.

POST /isube/login HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,
application/x-shockwave-flash, */*
Referer: https://sube.garanti.com.tr/isube/loginform
Accept-Language: tr
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
1.1.4322)
Host: sube.garanti.com.tr
Content-Length: 170
Connection: Keep-Alive
Cookie: JSESSIONID=0000Rm98xkHTrohrAUwy8JeWtDU:vmanfl6k
sid=1&textMARS=myuserid&PAROLA=mypass&textUSERCUSTNO=&hiddenCHOICE=1&LANG=TR&KANAL=G&count=3&hiddenPASSFIELD=H&hiddenTOKEN=&hiddenJVERSION=&girisButton.x=0&girisButton.y=0

and i do it with indy like this

  MyHttp := TIdHTTP.Create ;
  MyHttp.IOHandler := form1.IdSSLIOHandlerSocketOpenSSL1 ;

  MyHttp.AllowCookies          := True ;
  MyHttp.CookieManager          := Form1.IdCookieManager1 ;
  MyHttp.ProtocolVersion        := pv1_1 ;
  MyHttp.Request.Accept        := 'image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/vnd.ms-excel,application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*' ;
  MyHttp.Request.AcceptEncoding := 'gzip, deflate' ;
  MyHttp.Request.AcceptLanguage := 'tr' ;
  MyHttp.Request.Connection    := 'Keep-Alive' ;
  MyHttp.Request.ContentType  := 'application/x-www-form-urlencoded' ;
  MyHttp.Request.UserAgent    := 'Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; SV1; .NET CLR 1.1.4322)' ;

  PStream := TIdMultiPartFormDataStream.Create ;
  PStream.AddFormField ('sid',            '1') ;
  PStream.AddFormField ('textMARS',      'myuserid') ;
  PStream.AddFormField ('PAROLA',        'mypass')  ;
  PStream.AddFormField ('textUSERCUSTNO', '')  ;
  PStream.AddFormField ('hiddenCHOICE',  '1') ;
  PStream.AddFormField ('LANG',          'TR') ;
  PStream.AddFormField ('KANAL',          'G') ;
  PStream.AddFormField ('count',          '1') ;
  PStream.AddFormField ('hiddenPASSFIELD','H') ;
  PStream.AddFormField ('hiddenTOKEN',    '') ;
  PStream.AddFormField ('hiddenJVERSION', '') ;
  PStream.AddFormField ('girisButton.x',  '0') ;
  PStream.AddFormField ('girisButton.y',  '0') ;
  MyHttp.Request.ContentType := PStream.RequestContentType ;

  PUrl := 'https://sube.garanti.com.tr/isube/login HTTP/1.1' ;
  Form1.Memo1.Text := MyHttp.Post (PURL, PStream) ;

  PStream.Free ;
  MyHttp.Free ;

at the end it returms a page from server which says "we cannot do your
request know."
but the explorer returns next form that i want to get.

so what should i.

fer

Replies