Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdHTTP Put Method
#2
(08-27-2018, 03:39 PM)jjeffman Wrote: I need to use the Put method of TIdHTTP, but it is sending headers before the stream of requests.

As it should be, because that is how HTTP works.

(08-27-2018, 03:39 PM)jjeffman Wrote:
Code:
PUT ************* HTTP/1.1
// I need to put the stream here, before the following headers
Content-Length: 313
Host: 127.0.0.1:3004
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/3.0 (compatible; Indy Library)

How can I avoid those headers or at least put the headers I need before automatic headers ?

You cannot put a stream of data before request headers. What are you REALLY trying to accomplish? What is in your stream exactly? What is the server expecting the PUT request to look like exactly?

Are you, by chance, trying to send a chunked request (with a Transfer-Encoding: chunked request header), where the request contains trailing headers after the chunk data is finished? If so, TIdHTTP does not currently support sending a chunked request at this time (only reading chunked responses).

Reply


Messages In This Thread
TIdHTTP Put Method - by jjeffman - 08-27-2018, 03:39 PM
RE: TIdHTTP Put Method - by rlebeau - 08-27-2018, 07:50 PM
RE: TIdHTTP Put Method - by jjeffman - 08-28-2018, 05:46 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)