![]() |
IdHTTP.Post als HTTP/1.1 verschicken und Rang IdHTTP.Request
Liste der Anhänge anzeigen (Anzahl: 2)
Hallo,
habe folgende Probleme, mein Post wird immer als POST / HTTP/1.0 verschickt, möchte es aber als POST / HTTP/1.1 verschicken? Ich weiß nicht wo der Fehler liegt
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var data: TIdMultiPartFormDataStream; begin data := TIdMultiPartFormDataStream.Create; IdHTTP1.ProtocolVersion:=pv1_1; IdHTTP1.Request.UserAgent:='null'; IdHTTP1.Request.Accept:='eins'; IdHTTP1.Request.AcceptCharSet:='zwei'; IdHTTP1.Request.AcceptLanguage:='drei'; try { add the used parameters for the script } data.AddFormField('param1', 'value1'); data.AddFormField('param2', 'value2'); data.AddFormField('param3', 'value3'); { Call the Post method of TIdHTTP and read the result into TMemo } Memo1.Lines.Text := IdHTTP1.Post('http://www.delphipraxis.net', data); finally data.Free; end; end; Wie kann ich die Rangfolge von IdHTTP1.Request verändern, so das zum Beispiel der "User-Agent: null" vor Accept steht?
Delphi-Quellcode:
Dankeschön Thomas
[*]E Žîâ@ €Á¬À¨²U
"- PF6Š\û¥cÒPÿÿ|v POST / HTTP/1.0 Connection: keep-alive Content-Type: multipart/form-data; boundary=--------051909045300140 Content-Length: 281 Host: [url]www.delphipraxis.net[/url] Accept: eins Accept-Charset: zwei Accept-Encoding: identity Accept-Language: drei User-Agent: null |
Re: IdHTTP.Post als HTTP/1.1 verschicken und Rang IdHTTP.Req
Indy verwendet immer 1.0, siehe IdHTTP.pas:
Zitat:
Oder es hilft, die Options Property hoKeepOrigProtocol zu setzen (auch aus IdHTTP.pas): Zitat:
Cheers, |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:35 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz