Parametros dinamicos
stonestecnologia opened this issue · 2 comments
stonestecnologia commented
Grande Vini !
Existe uma possibilidade de passar paramentos dinâmicos ?
Algo do tipo :
var
LResponse: IResponse;
begin
LResponse := TRequest.New.BaseURL('http://localhost:8888/users')
if A.Text <> EmptyStr then
.AddParam('A', A.Text)
if B.Text <> EmptyStr then
.AddParam('B', B.Text)
if C.Text <> EmptyStr then
.AddParam('C', C.Text)
.Accept('application/json')
.Get;
if LResponse.StatusCode = 200 then
ShowMessage(LResponse.Content);
end;
Os if's foi so pra vc entender a necessidade, rsrsrs.
Valeu Mestre!!
viniciussanchez commented
var
LResponse: IResponse;
LRequest: IRequest;
begin
LRequest := TRequest.New
.BaseURL('http://localhost:8888/users')
.Accept('application/json');
if A.Text <> EmptyStr then
LRequest.AddParam('A', A.Text);
if B.Text <> EmptyStr then
LRequest.AddParam('B', B.Text);
if C.Text <> EmptyStr then
LRequest.AddParam('C', C.Text);
LResponse := LRequest.Get;
if LResponse.StatusCode = 200 then
ShowMessage(LResponse.Content);
end;stonestecnologia commented
Obrigado.
Eu imaginei q teria algo parecido com o LINQ.
Sucesso.