Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 02-11-2006
tefots tefots is offline
Miembro
 
Registrado: feb 2005
Posts: 108
Poder: 20
tefots Va por buen camino
volviendo al tema

aqui pongo un ejemplo de como hacer un post usando las indy.
creo que es mas sencillo que usando las wininet.

el get seria parecido.


Código Delphi [-]
procedure TForm1.SendPostData;
Var
  aStream: TMemoryStream;
  Params: TStringStream;
begin
  aStream := TMemoryStream.create;
  Params := TStringStream.create('');

  try
    with IdHTTP1 do
    begin
      Params.WriteString(URLEncode('teste=' + 'yes' + '&'));
      Params.WriteString(URLEncode('name=' + 'ivan' + '&'));
      Params.WriteString(URLEncode('number=' + '102'));
      Request.ContentType := 'application/x-www-form-urlencoded';
      try
        Post('http://localhost/teste.asp', Params, aStream);
      except
        on E: Exception do
          showmessage('Error encountered during POST: ' + E.Message);
      end;
    end;
  aStream.WriteBuffer(#0' ', 1);
  aStream.Position := 0;
  Memo1.Lines.LoadFromStream(aStream);
  except
  end;
end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Automatizacion de word (generar documentos) alt126 C++ Builder 4 24-04-2007 04:19:27
Automatizacion de word (insertar tablas) alt126 C++ Builder 2 04-11-2005 10:44:29
Consejo Automatizacion Excel Builder C++ alt126 C++ Builder 0 14-04-2005 10:52:04
HTTP Indy bochi Internet 1 27-12-2003 01:57:34
Http Server ebeltete Internet 0 17-05-2003 02:57:39


La franja horaria es GMT +2. Ahora son las 07:49:01.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi