Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 May : simple post

www.cryer.info
Managed Newsgroup Archive

simple post

Subject:simple post
Posted by:"Vlad Gonchar" (vgonch..@performancesoft.com)
Date:Sun, 22 May 2005 12:26:01

Can someone take a look at the code, please. What I am missing?

This POST been repeated 1000 times (Payload is 100 bytes)
causes HTTP client error: "Socket error #10048. Address already in use."
If payload is 1024 bytes, it says error "HTTP/1.1 405 Method is no allowed"
at first post.


procedure TForm1.DoPostIndy( const Url: string; const Payload: string );
var
  aContentStream: TStringStream;
  aContent, aResponse: string;
begin
  aContentStream  := TStringStream.Create( StringToBase64( Payload ) );
  try
    IdHTTP1.Request.ContentLength := aContentStream.Size;
    aResponse := IdHTTP1.Post( Url, aContentStream ); /
    aResponse := Base64ToString( aResponse ); // decode content from base64
  finally
    aContentStream.Free;
  end;
end;

Replies:

www.cryer.info
Managed Newsgroup Archive