Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post in HTTPs
#1
Hi, I have a problem with a call in https with method POST.

from the documentation...
...
POST /auth/signin  

the url is
https://demoauth.fatturazioneelettronica.aruba.it

this the istruction

"...
POST /auth/signin?grant_type=password&username=Utente&password=Password HTTP/1.1

Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Content-Length: 56
Host: localhost:8080
..."

when try to executo the code i receive this error

"...Error HTTP/1.1 400 Bad request'



-----------------------------------------------------------
this my Code:
Delphi 10.2.2 Tokyo
-----------------------------------------------------------
var
  lHTTP: TIdHTTP;
  lParamList: TStringList;
 HttpAutenticazione : string;
begin
 HttpAutenticazione := 'https://demoauth.fatturazioneelettronica.aruba.it';
  lParamList := TStringList.Create;
  lParamList.Add('grant_type=password');
  lParamList.Add('username=demo');
  lParamList.Add('password=demo');

  lHTTP := TIdHTTP.Create;
  lHTTP.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(lHTTP);

  lHTTP.HandleRedirects := True;
  lHttp.Request.ContentType := 'application/x-www-form-urlencoded;charset=UTF-8';
  lHttp.Request.ContentLength := 56;
  lHttp.Request.Host := 'localhost:8080';
  try
      Result := lHTTP.Post(HttpAutenticazione+'/auth/signin', lParamList);
  finally
    lHTTP.Free;
    lParamList.Free;
  end;
Reply


Messages In This Thread
Post in HTTPs - by staff@ergosoft.it - 10-25-2018, 07:33 AM
RE: Post in HTTPs - by rlebeau - 10-25-2018, 07:40 PM
RE: Post in HTTPs - by staff@ergosoft.it - 10-26-2018, 06:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)