indy

Use PUT to upload file with TIdHTTP

穿精又带淫゛_ 提交于 2020-07-23 04:41:19
问题 I'd like to upload a file using PUT on TIdHtttp. I found an answer from Remy Lebeau saying to not use PUT, but use POST instead. But, in my case I can't do it because I'm using a third API, and it specifies that I need to use PUT. If I try to use POST, it returns me a message saying that the Method is not allowed. Basically, I'm trying to do something like this: Response := TStringStream.Create; DS := TIdMultiPartFormDataStream.Create; DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop

Use PUT to upload file with TIdHTTP

女生的网名这么多〃 提交于 2020-07-23 04:39:22
问题 I'd like to upload a file using PUT on TIdHtttp. I found an answer from Remy Lebeau saying to not use PUT, but use POST instead. But, in my case I can't do it because I'm using a third API, and it specifies that I need to use PUT. If I try to use POST, it returns me a message saying that the Method is not allowed. Basically, I'm trying to do something like this: Response := TStringStream.Create; DS := TIdMultiPartFormDataStream.Create; DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop

Use PUT to upload file with TIdHTTP

五迷三道 提交于 2020-07-23 04:38:18
问题 I'd like to upload a file using PUT on TIdHtttp. I found an answer from Remy Lebeau saying to not use PUT, but use POST instead. But, in my case I can't do it because I'm using a third API, and it specifies that I need to use PUT. If I try to use POST, it returns me a message saying that the Method is not allowed. Basically, I'm trying to do something like this: Response := TStringStream.Create; DS := TIdMultiPartFormDataStream.Create; DS.AddFile('fileUpload2', 'C:\Users\r.rezino\Desktop

How do I upload a file using http post? Delphi 2009

人走茶凉 提交于 2020-07-05 07:26:56
问题 My goal is to upload a text file via HTTP post I am using Delphi 2009. Say for example to the following URL https://www.example.com/ex/exampleAPI.asmx/Process I understand it can be done by using the TIdHttp component. And the following call IdHttp1.Post(); But I cant figure out how to set up everything i.e. specifying the url and including the file to be posted. Thanks. 回答1: TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1

How do I upload a file using http post? Delphi 2009

偶尔善良 提交于 2020-07-05 07:25:10
问题 My goal is to upload a text file via HTTP post I am using Delphi 2009. Say for example to the following URL https://www.example.com/ex/exampleAPI.asmx/Process I understand it can be done by using the TIdHttp component. And the following call IdHttp1.Post(); But I cant figure out how to set up everything i.e. specifying the url and including the file to be posted. Thanks. 回答1: TIdHTTP has two overloaded versions of Post() that take a filename as input: var Response: String; Response := IdHTTP1

Upgrade Indy library to use latest OpenSSL library

别来无恙 提交于 2020-06-25 05:40:29
问题 What is the process of upgrading Indy library written in Delphi to use the latest OpenSSL library having the newest features (eg. TLS v1.3)? The last version of Indy library I found uses libssl32.dll and ssleay32.dll DLLs. The latest OpenSSL library produces libssl-1_1.dll and libcrypto-1_1.dll DLLs. By changing the DLL names in Indy libray the dynamic loading of OpenSSL DLLs fails because many functions defined in Indy do not match the functions of OpenSSL DLLs. Thus OpenSSL API was changed.

How can we connect with a website? Getting SSL error 1409442E

♀尐吖头ヾ 提交于 2020-03-16 06:22:17
问题 I am using Delphi 10.2 Tokyo, trying to download some information from a web server. I pass the command URL https://poloniex.com/public?command=returnCurrencies through this function using Indy 10.6.2.5366 (the command works if I paste it in a browser): function ReadHTTPS(const url: string): string; var IdHTTP: TIdHTTP; IdSSL: TIdSSLIOHandlerSocketOpenSSL; begin IdHTTP := TIdHTTP.Create; try IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP); IdHTTP.IOHandler := IdSSL; result := IdHTTP.Get

How can we connect with a website? Getting SSL error 1409442E

两盒软妹~` 提交于 2020-03-16 06:22:01
问题 I am using Delphi 10.2 Tokyo, trying to download some information from a web server. I pass the command URL https://poloniex.com/public?command=returnCurrencies through this function using Indy 10.6.2.5366 (the command works if I paste it in a browser): function ReadHTTPS(const url: string): string; var IdHTTP: TIdHTTP; IdSSL: TIdSSLIOHandlerSocketOpenSSL; begin IdHTTP := TIdHTTP.Create; try IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP); IdHTTP.IOHandler := IdSSL; result := IdHTTP.Get

IdHTTP how to send raw body

强颜欢笑 提交于 2020-02-21 02:55:50
问题 How i can use IdHTTP to send message as PostMan dos below: My first attempt was as follow: function TIdFoo.SendIM(const AID, AMessage: string): Boolean; const _URL = 'https://URL.com/SendMessage'; var Params : TStringStream; Response : string; LMsg : string; begin Result := False; LMsg := '-----------------------------13932'+ 'Content-Type: application/json; charset=utf-8'+ 'Content-Description: message'+ sLineBreak+ '{"message":{"Type":1,"body":"'+AMessage+'"},"to":["'+AID+'"]}'+ '----------

Failed to decode response content using IdHttp

淺唱寂寞╮ 提交于 2020-02-16 05:48:50
问题 I use TIdHttp to fetch web content. The response header indicates the content encoding to be utf8. I want to print content in console as CP936 (simplified chinese), but the actual content is not readable. Result := TEncoding.Utf8.GetString(ResponseBuffer); I do the same thing in python (using httplib2) without any problems. def python_try(): conn = httplib2.HttpConn() respose, content = conn.get(...) print content.decode('utf8') # readable in console UPDATE 1 I debugged the raw response and