Ver Mensaje Individual
  #3  
Antiguo 16-06-2020
novato_erick novato_erick is offline
Miembro
 
Registrado: ago 2010
Ubicación: Panamá
Posts: 396
Reputación: 14
novato_erick Va por buen camino
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
¿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; {'http://app.dominio.com/api'; al usar https me manda el error también antes escrito error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure}
  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;
Responder Con Cita