Cita:
Empezado por Neftali [Germán.Estévez]
¿Exactamente cómo añades los parámetros a la cabecera en RESTDebugger?
Hay varias formas de hacerlo...
|
Agradecido por recibir respuesta Neftali y es un privilegio que prestes atención a mi duda:
1-Por la misma aplicación REST Debugger de Embarcadero
Pestaña de Resquest:
GET (
http://app.dominio.com/api)
Cita:
Si aplico https me manda error REST request failed: Error connecting with SSL. error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure pero este es tema de otro hilo de foro
|
Content-Type: application/json
Pestaña de parámetro
Add
Kind
HEADER
Name: X-IFX-Token
Value: f22db1478793f17cd4d5dfdasdcfasdfxxxxxx
y Así los otros parametros como:
Add
Kind
[GET/POS]
Name: action
Value: customers
Add
Kind
[GET/POS]
Name: action
Value: customers
2-Copiando los componente desde REST Debugger de Embarcadero y pegandolo en el modulo
y modificando igual las propiedades. //Pero en principio es lo mismo que en la primera opción presentada
3-ahora mismo intentando :
Código Delphi
[-]
procedure TuConfigura.Button1Click(Sender: TObject);
var
UrlConectar: String;
RESTClient1: TRESTClient;
RESTResponse1 : TRESTResponse;
begin
UrlConectar := eURL.Text;
try
RESTClient1 := TRESTClient1.Create(nil);
try
RESTResponse1.Create(nil);
try
RESTClient1.BaseURL := UrlConectar;
RESTClient1.SetHTTPHeader('X-IFX-Token:', 'f22db1478793f17cd4d5dfdasdcfasdfxxxxxxf');
finally
RESTClient1.Free;
end;
if Assigned(RESTResponse1.JSONValue) then
begin
TextoRespuesta := TJson.Format(RESTResponse1.JSONValue);
end
else
begin
TextoRespuesta := RESTResponse1.Content;
end;
finally
RESTResponse1.Free;
end;
except
on E: Exception do
ShowMessage(E.ClassName + ': ' + E.Message);
end;
end;
Agradeciendo su colaboracion;
Saludos;