Error returning from get from Delphi to php

Asked

Viewed 336 times

0

Upload the following get in php

http://site.com.br/Autenticacao/index.php?conteudo={"Login":"[email protected]","Senha":"123","Posicao":{"Latitude":"-18.8693459","Longitude":"-41.955664"}}

And I get

http://site.com.br/Autenticacao/index.php?Situcao=O&idCliente=714107-e72ca8-9aca93-0ec496-cc0e30

I sent a json and returned a get, but even returning in json from the same error.

Ate ai roda blza, plus when I do in Delphi, returns the following error

HTTP/1.1.302.Moved Temporary

I’m doing it this way in Delhi

procedure TForm2.Button1Click(Sender: TObject);
var     Urls  : string;
begin

   Urls := 'http://usebum.com.br/Autenticacao/index.php?conteudo={"Login":"[email protected]","Senha":"123","Posicao":{"Latitude":"-18.8693459","Longitude":"-41.955664"}}';
   urls := IdHTTP1.Get(Urls);
end;

I’m using the 2010 Delphi

1 answer

1


Try saving the answer in a Stringstream.

procedure TForm2.Button1Click(Sender: TObject);
    var     Urls  : string;
    lResponse : TStringStream;
    begin
    lResponse := TStringStream.Create('');

    try
    urls := IdHTTP1.Get('http://usebum.com.br/Autenticacao/index.php?conteudo={"Login":"[email protected]","Senha":"123","Posicao":{"Latitude":"-18.8693459","Longitude":"-41.955664"}}', lResponse);
    finally
    lResponse.Free();
end;

lResponse will contain the contents of the page

  • test, gave no error, but returns nothing, returns empty.

  • Weird. I tested the request URL here and it’s also returning a blank page. Is it not a problem on this page that receives the request?

  • It worked out just like that,what was breaking and what generated a redirect at the end of the script,I removed and went. Your blank screen is because I removed the test content. Thank you for your tip.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.