Estefanie 0 Posted September 22, 2020 Hello guys, I am getting this error when doing a GET in a url. "404 Connection aborted on request" SslHttpCli := TSslHttpCli.Create(nil); sendStream := TMemoryStream.Create; rcvStream := TMemoryStream.Create; SslHttpCli.SslContext := SslContext1.Create(nil); SslHttpCli.ServerAuth := httpAuthNone; SslHttpCli.Connection := 'keep-alive'; SSlHttpCli.ProxyConnection := 'Keep-Alive'; SslHttpCli.MultiThreaded := true; SslHttpCli.URL := 'https://www.poemist.com/api/v1/randompoems'; SslHttpCli.SendStream := sendStream; SslHttpCli.NoCache := False; SslHttpCli.ContentTypePost := 'application/json'; SslHttpCli.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'; try SslHttpCli.Get; stringStream := TStringStream.Create('', TEncoding.UTF8); stringStream.LoadFromStream(SslHttpCli.RcvdStream); data := stringStream.DataString; mResult.Lines.Add(data); stringStream.Free; Share this post Link to post
Angus Robertson 574 Posted September 23, 2020 I suggest you build the OverbyteIcsHttpRestTst.dpr sample first and test your URL using that, then change your code to use TSslHttpRest instead of TSslHttpCli. it is much easier to use and the sample has several examples of how easy. Angus Share this post Link to post
Estefanie 0 Posted September 23, 2020 Can you use OverbyteIcsHttpRestTst in delphi XE2? Share this post Link to post
Angus Robertson 574 Posted September 24, 2020 All ICS samples are tested with Delphi 2007 and later, and should still work with Delphi 7. Angus Share this post Link to post
Estefanie 0 Posted September 24, 2020 how to use OverbyteIcsHttpRestTst , it's a similar TSslHttpCli? Share this post Link to post
Angus Robertson 574 Posted September 24, 2020 TSslHttpRest is descened from TSslHttpCli so is similar to use, but much easier, try the sample application. and http://wiki.overbyte.eu/wiki/index.php/FAQ_Using_TSslHttpRest. Angus 1 Share this post Link to post