IltonK
Members-
Content Count
5 -
Joined
-
Last visited
Everything posted by IltonK
-
Httpcliet (post) x Httpserver (Passando parametros)
IltonK posted a topic in ICS - Internet Component Suite
Olá, alguem pode me ajudar, estou comecando agora no ICS e não estou conseguindo enviar de com POST do httpclient e passando parametros, e recebendo no httpserver, no caso ele faz até a comunicacao normal porem não recebe os dados passados do parametros. HTTPCLIENT: procedure THttpPostForm.PostButtonClick(Sender: TObject); begin HttpCli1.ServerAuth:=httpAuthDigest; Data := 'FirstName=' + UrlEncodeToA(Trim(FirstNameEdit.Text)) + '&' + //PARAMETROS 'LastName=' + UrlEncodeToA(Trim(LastNameEdit.Text)) + '&' + 'Submit=Submit'; HttpCli1.SendStream := TMemoryStream.Create; HttpCli1.SendStream.Write(Data[1], Length(Data)); HttpCli1.SendStream.Seek(0, 0); HttpCli1.RcvdStream := TMemoryStream.Create; HttpCli1.URL := Trim(ActionURLEdit.Text); HttpCli1.ContentTypePost := 'application/x-www-form-urlencoded'; StartTime := 0; HttpCli1.PostAsync; end; NO SERVER: procedure TSslWebServForm.SslHttpServer1PostDocument( Sender : TObject; { HTTP server component } Client : TObject; { Client connection issuing command } var Flags : THttpGetFlag); { Tells what HTTP server has to do next } var ClientCnx : TMyHttpConnection; begin ClientCnx := Client as TMyHttpConnection; displaymemo.Lines.Add('POST DOCUMENT: ' + CLIENTCNX.Params); //parametros sempre vem vazio end. o que estou fazendo de errado ? -
Httpcliet (post) x Httpserver (Passando parametros)
IltonK replied to IltonK's topic in ICS - Internet Component Suite
I'm not getting it... but I'll keep trying, since the ICS is for now, thank you very much, if there's any news, I'll post it here. thank you very much -
Httpcliet (post) x Httpserver (Passando parametros)
IltonK replied to IltonK's topic in ICS - Internet Component Suite
I'm using it at: SslHttpServer1PostDocument error: 17:17:20:908 Handle Background Exception, source: TCustomWSocket.ASyncReceive - Access violation at address 00F194DF in module 'OverbyteIcsSslWebServ.exe' (offset B94DF). Read of address 00000000 -
Httpcliet (post) x Httpserver (Passando parametros)
IltonK replied to IltonK's topic in ICS - Internet Component Suite
I'm trying to read the request body but it returns an error: var ClientCnx : TMyHttpConnection; ContentStream: TStringStream; ContentString: string; begin ClientCnx := Client as TMyHttpConnection; ContentStream := TStringStream.Create; ContentStream.LoadFromStream(ClientCnx.DocStream); ContentString := ContentStream.DataString; ShowMessage('Conteúdo recebido: ' + ContentString); -
Httpcliet (post) x Httpserver (Passando parametros)
IltonK replied to IltonK's topic in ICS - Internet Component Suite
Sorry for sending in Portuguese. Yes, data = Ansistring I'm even using the examples (demo) that come in the package for testing OverbyteIcsHttpPost = using to post OverbyteIcsSslWebServ or OverbyteIcsBasicWebServer I was unable to make it read the parameters in either of the two server examples. It communicates but does not receive the parameters. The only way it can receive them would be to pass them directly to the URL, for example: http://192.168.1.10/teste?codigo=10 In this case, it identifies the parameters But when I send them via HttpCli1.SendStream, I get no response, it arrives empty.