Re: Problems regarding a HTTP.Post and TIdMultiPartFormDataStream

Giganews Newsgroups
Subject: Re: Problems regarding a HTTP.Post and TIdMultiPartFormDataStream
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Wed, 1 Jun 2005

"R. Hoek" <ho…@componentagro.nl> wrote in message
news:5C6171B10CCDE240ho…@componentagro.nl...

> Below is the code I use to send it using the MultiPartFormData
> streamopbject:

The HTML is not sending multipart form data to begin with, so using
TIdMultiPartFormDataStream was not the correct choice to begin with.

    _Data := TStringStream.Create(FMsgData);
    try
        SetResponse(FHTTP.Post(sSendMessagePostURL, _Data));
    finally
        FreeAndNil(_Data);
    end;

> Only then it return HTML reponse error "HTTP/1.1 400 Bad Request"...
> Any idea of what's going wrong?

If you use a packet sniffer, such as Ethereal, you can find out exactly what
the browser is really sending to the server.  Then you can make Indy mimic
it accordingly.

Gambit

Replies

In response to

Problems regarding a HTTP.Post and TIdMultiPartFormDataStream posted by R. Hoek on Wed, 1 Jun 2005