Discussion:
IdHTTP + SSL (Google Calendar API)
(too old to reply)
h***@gmail.com
2008-08-02 13:53:03 UTC
Permalink
Hi,
I try to connect to the Google Calendar API, getting authorizeted.

I found this code as seen below from 2006. I put it together and
copied there the
SSL dlls, too.

It seems that I get a correct ResponseCode = 200 but after that the
SSLIOHandler does not seem to function.

Should I set any properties on the SSLIOHandlerSocketOpenSSL?

(Indy and thr SSL dlls seem fine as I could read a GMail POP3 account
with them.)

Thank you for your help.

============================================
Authorization for Google Calendar

drop a button, a Tidhttp, TIdSSLIOHandlerSocketOpenSSL, and a TMemo on
the
form. Set the IOHandler for IDHTTP to the
IdSSLIOHandlerSocketOpenSSL1.
Then in the button's OnClick event do the following:

procedure TForm1.Button1Click(Sender: TObject);
var
stringStream: TIdStringStream;
postStrings: TidStringList;
postResult: string;
begin
postStrings := TIdStringList.Create;
try
postStrings.LineBreak := '&';
postStrings.Values['Email'] := 'email';
postStrings.Values['Passwd'] := 'passwod';
postStrings.Values['service'] := 'cl';
postStrings.Values['source'] := 'company-program-version';

stringStream := TIdStringStream.Create(postStrings.Text);
try
IdHTTP1.Request.ContentType := 'application/x-www-form-
urlencoded';
postResult := IdHTTP1.Post('https://www.google.com/accounts/
ClientLogin', stringStream);
Memo1.Lines.Add(postResult);
finally
stringStream.Free;
end;
finally
postStrings.Free;
end;
end;
tibi
2008-08-11 17:22:58 UTC
Permalink
The newest Indy10 and openssl dlls solved it.

Loading...