idhttp

The input is not a valid Base-64 string Error, My JSON uses double quotation marks instead of single quotations

我与影子孤独终老i 提交于 2019-12-25 03:18:57
问题 I am trying to send a JSON post, but my JSON seems to differ a little bit from what the site usually sends Here is what i am sending: {"CodeNumberTextBox":"","txusername":"yC6IBEbznlRlKOKv8zrhiA","txpass":"pAQAyrr5u9/hK35iTIlt7Q=="} Here is what the website sends when you click login: { CodeNumberTextBox:'', txusername:'yC6IBEbznlRlKOKv8zrhiA', txpass:'pAQAyrr5u9/hK35iTIlt7Q==' } Here is the error i get when i send my JSON: 'The input is not a valid Base-64 string as it contains a non-base 64

Find out the type of file ( GIF, JPG, PNG) - DELPHI

南楼画角 提交于 2019-12-23 03:33:15
问题 I'm carrying images per URL and showing TImage . I will work with JPG , GIF and PNG . But I do not know how to find out what kind of extension possess each file, and then differentiate. How do I get header , or any other method for me to know what type of file: GIF or PNG or JPG? var MS : TMemoryStream; GIf: TGIFImage; jpegimg: TJPEGImage; begin MS := TMemoryStream.Create; GIf := TGIFImage.Create; jpegimg := TJPEGImage.Create; /////// try try IdHTTP1.get('http://forum.wmonline.com.br/uploads

Delphi: TIdHTTP vs TNetHTTPClient

走远了吗. 提交于 2019-12-22 17:59:23
问题 I'm writing a download manager in Delphi with some custom features like resumable downloads and downloading through proxies. I'm studing different component solutions: Indy and NetHTTP, both seem very close. TNetHTTPClient seem to be an interface of winhttp.dll . TIdHTTP seem to be an interface of wininet.dll (but i'm not sure). TIdHTTP seems like a very old component (maybe very stable/tested) and has tons of documentation online. TNetHTTPClient seems to be a very recent component, and doesn

Delphi: Using Google URL Shortener with IdHTTP - 400 Bad Request

ぐ巨炮叔叔 提交于 2019-12-21 05:29:05
问题 I'm trying to access the URL Shortener ( http://goo.gl/ ) via its API from within Delphi. However, the only result I get is: HTTP/1.0 400 Bad Request (reason: parseError) Here is my code (on a form with a Button1 , Memo1 and IdHTTP1 that has IdSSLIOHandlerSocketOpenSSL1 as its IOHandler. I got the necessary 32-bit OpenSSL DLLs from http://indy.fulgan.com/SSL/ and put them in the .exe's directory): procedure TFrmMain.Button1Click(Sender: TObject); var html, actionurl: String; makeshort:

How do I include a file in a TIdMultiPartFormDataStream for use with Indy IdHTTP1.Post?

*爱你&永不变心* 提交于 2019-12-18 09:00:08
问题 What is the correct code that I need to use to send one or more files of any type along with other parameters using Indy's idHTTP.post? (using Delphi 2009 and Indy 10) The post in question calls a function in a commercial company's API (ElasticEmail) that sends out emails to the recipients held in one of the parameters. (A link to the documentation on the function I am calling is here. I have example code in C# and other languages from the company here and I have tried to replicate that code

Delphi: IdHTTP+SSL does not work. No errors!

心不动则不痛 提交于 2019-12-18 02:51:20
问题 I use TidHTTP + TIdSSLIOHandlerSocketOpenSSL + 2 DLLs: ssleay32.dll and libeay32.dll from http://indy.fulgan.com/SSL. But I can see all work of my program in HTTP Analyzer! It works as HTTP, not as HTTPS. If I use Opera I cannot see downloading with the same site (https://esta.cbp.dhs.gov/esta). I did not set any special parameters for TidHTTP and TIdSSLIOHandlerSocketOpenSSL (may be I must but I do not know what exactly). Must I use TIdSSLVersion(sslvSSLv23) + location of a SSL certificate?

TIdHTTP and TLS SNI doesnt work

 ̄綄美尐妖づ 提交于 2019-12-17 20:52:29
问题 On my attempt the TLS SNI extension is missing. I don't know why. Can someone point me in the right direction? Embarcadero® RAD Studio 10 Seattle Version 23.0.21418.4207 Indy version: 10.6.2.5311 OpenSSL: https://indy.fulgan.com/SSL/openssl-1.0.2h-i386-win32.zip The (WireShark) result is the same with and without the workaround. Example/demonstration code: unit CMTelekomTest; ... var IdHTTP1: TIdHTTP; IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL; xml: ixmldocument; root, node,

Socket Error #113 No route to host on Android

三世轮回 提交于 2019-12-13 15:17:35
问题 In a Delphi XE6 FireMonkey app, when I press the button, I get the following error on Android: Socket Error #113 No route to host procedure TForm1.Button1Click(Sender: TObject); var Intent: JIntent; datosPost: TIdMultiPartFormDataStream; mRespuestaPost: String; begin try datosPost := TIdMultiPartFormDataStream.Create; datosPost.AddFormField('usuario', txtUser.Text); datosPost.AddFormField('password', txtPass.Text); mRespuestaPost := DataModule2.IdHTTP.Post ('http://X.X.X.X/CGLB/ac.php',

How to clear the Indy TIdHTTP BasicAuthentication credentials?

回眸只為那壹抹淺笑 提交于 2019-12-13 02:22:15
问题 I'm using the Indy TIdHTTP for get request with BasicAuthentication. Code working fine, but TIdHTTP doesn't clearing the BasicAuthentication credentials after first 401, if user retype the credentials and send request again, with right login-password. User must login twice to authorize. User action sequence: Step 1. User type wrong login-password: ResponseCode = 401 Step 2. User type right login-password: ResponseCode = 401 Step 3. User type right login-password: ResponseCode = 200 Result on

Delphi Indy IdHTTP Authorization

你说的曾经没有我的故事 提交于 2019-12-11 12:43:29
问题 I'm trying to get user photos in Exchange using IdHTTP through REST API How to: Get user photos by using EWS in Exchange procedure TsMain.IdHTTP1Authorization(Sender: TObject; Authentication: TIdAuthentication; var Handled: Boolean); begin Authentication.Username := DomainName +'\'+ User; Authentication.Username := User + #64 + DomainName; Authentication.Password := Password; Handled:=true; end; function TsMain.GetUserPhoto(const eMail: string):Boolean; var s: TStream; ResponseCode: Integer;