Created
August 25, 2021 14:33
-
-
Save viniciussanchez/5f17f4556466b72df4fe43a5a943e968 to your computer and use it in GitHub Desktop.
x-www-form-urlencoded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
procedure TServiceLogin.Example; | |
var | |
LResponse: IHTTPResponse; | |
LFormUrlencoded: TStringList; | |
LRequest: THTTPClient; | |
begin | |
LRequest := THTTPClient.Create; | |
LFormUrlencoded := TStringList.Create; | |
try | |
LFormUrlencoded.Add('grant_type=my-grant-type'); | |
LFormUrlencoded.Add('client_id=my-client-id'); | |
LFormUrlencoded.Add('client_secret=my-client-secret'); | |
LResponse := LRequest.Post(Servers.Keycloak, LFormUrlencoded); | |
if LResponse.StatusCode = 200 then | |
begin | |
// Write your code here!!! | |
end; | |
finally | |
LFormUrlencoded.Free; | |
LRequest.Free; | |
end; | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment