Ver Mensaje Individual
  #6  
Antiguo 06-04-2019
IVAND IVAND is offline
Miembro
 
Registrado: may 2003
Ubicación: ECUADOR
Posts: 523
Reputación: 21
IVAND Va por buen camino
Gracias Dev , por tu amable dedicacion ,

Mira logre consumir el servicio de esta manera como es uan pagina https

agrege esto

Código Delphi [-]
procedure TForm1.btn1Click(Sender: TObject);
var
Urls:string ;
LHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
  LHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  IdHTTP1.Request.CustomHeaders.Values['X-MANTISAPI-CODE'] := 'eeXahKo8';
  IdHTTP1.IOHandler:=LHandler;
  memo1.Lines.Add(IdHTTP1.Get('https://inprise.integral.ec/api/consulta-identificacion/?identificacion=1308325354001'));
end;

Recibo ya la informacion , pero de una manera muy rara , como si fuera una pagina web que se embebe en un navegador , los datos que debe emviar son

Código PHP:
to `json`">json</a>
                        </li>
                      
                        <li>
                          <a class="
js-tooltip format-option" href="/api/consulta-identificacion/?format=api&amp;identificacion=1308325354001" rel="nofollow" title="Make a GET request on the Consulta Datos Identificacion resource with the format set to `api`">api</a>
                        </li>
                      
                    </ul>
                  </div>
                
              </fieldset>
            </form>
          

          
            <form class="
button-form" action="/api/consulta-identificacion/?identificacion=1308325354001" data-method="OPTIONS">
              <button class="
btn btn-primary js-tooltip" title="Make an OPTIONS request on the Consulta Datos Identificacion resource">OPTIONS</button>
            </form>
          

          

          
          </div>

            <div class="
content-main" role="main"  aria-label="main content">
              <div class="
page-header">
                <h1>Consulta Datos Identificacion</h1>
              </div>
              <div style="
float:left">
                
                  <p></p>
                
              </div>

              

              <div class="
request-info" style="clearboth" aria-label="request info">
                <pre class="
prettyprint"><b>GET</b> /api/consulta-identificacion/?identificacion=1308325354001</pre>
              </div>

              <div class="
response-info" aria-label="response info">
                <pre class="
prettyprint"><span class="meta nocode"><b>HTTP 200 OK</b>
<b>Allow:</b> <span class="
lit">OPTIONS, GET</span>
<b>Content-Type:</b> <span class="
lit">application/json</span>
<b>Vary:</b> <span class="
lit">Accept</span>

</span>{
    &quot;tipo_contribuyente&quot;: &quot;PERSONAS NATURALES&quot;,
    &quot;actividad_economica&quot;: &quot;VENTA AL POR MAYOR DE MATERIALES DE CONSTRUCCIÓN: PIEDRA, ARENA, GRAVA, CEMENTO, ETCÉTERA.&quot;,
    &quot;clase_contribuyente&quot;: &quot;OTROS&quot;,
    &quot;estado_contribuyente&quot;: &quot;ACTIVO&quot;,
    &quot;nombres_completos&quot;: &quot;ANCHUNDIA DELGADO JOSE RAFAEL&quot;,
    &quot;direccion&quot;: &quot;MANABI/PORTOVIEJO/12 DE MARZO/RAMOS IDUARTE S/N TERCERA Y CUARTA TRANSVERSAL&quot;,
    &quot;nombre_comercial&quot;: &quot;DEPOSITO ANCHUNDIA&quot;,
    &quot;obligado&quot;: &quot;S&quot;
}</pre>
              </div>
            </div>

            
              

              
            
          
        </div><!-- /.content -->
      </div><!-- /.container -->
    </div><!-- ./wrapper -->

    

    
      <script>
        window.drf = {
          csrfHeaderName: "
X-CSRFTOKEN",
          csrfCookieName: "
csrftoken"
        };
      </script>
      <script src="
/static/rest_framework/js/jquery-1.12.4.min.4f252523d4af.js"></script>
      <script src="
/static/rest_framework/js/ajax-form.0ea6e6052ab5.js"></script>
      <script src="
/static/rest_framework/js/csrf.753b7a1f2ee7.js"></script>
      <script src="
/static/rest_framework/js/bootstrap.min.5869c96cc8f1.js"></script>
      <script src="
/static/rest_framework/js/prettify-min.709bfcc456c6.js"></script>
      <script src="
/static/rest_framework/js/default.b846d7d305c9.js"></script>
      <script>
        $(document).ready(function() {
          $('form').ajaxForm();
        });
      </script>
    

  </body>
  
</html> 
Cuando deberia enviar en JSON , este servicio esta probado en python, sera que me falta algo mas para darle formato en los indy o sera normal asi en delphi que retorne aunq en la web de neftaly un api rest devuelve un json tal cual debe ser


Nuevamente aprecio mucha tu ayuda , un abrazo
__________________
IVAND

Última edición por dec fecha: 06-04-2019 a las 09:42:59. Razón: Poner etiquetas DELPHI
Responder Con Cita