FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TIPClientHttp() - ERROR
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
TIPClientHttp() - ERROR
Posted: Tue Oct 14, 2025 07:48 PM
Buenas tardes a todos,
Tengo un problema con el siguiente c贸digo que no soy capaz de resolver y dejo aqu铆 por si alguien me puede aportar algo de luz:
#require "hbssl"
#require "hbtip"

PROCEDURE pruebahttps()
   LOCAL cPostData, cResponse
   LOCAL cUrl := "https://api.juanillo.es/json/api/transaction"
   LOCAL oClient := TIPClientHttp():New( cUrl )  // Inicializar el cliente HTTP

   if oClient:Open()
      msginfo(oClient:Open(), "oClient:Open()")
   else
      msginfo(oClient:Open(), "ERROR: oClient:Open()")
      return
   endif

   // Datos a enviar en el cuerpo del POST (por ejemplo, en formato JSON)
   cPostData := '{"clave":"valor", "otro":"dato"}'

   // Configurar la solicitud
   oClient:nConnTimeout := 5000  // Timeout de conexi贸n (5 segundos)
   oClient:lSSL         := .T.   // Habilitar SSL para HTTPS

   // Abrir conexi贸n
   IF oClient:Open()
      // Enviar solicitud POST
      oClient:Post( cPostData, "application/json" )
      cResponse := oClient:cReply

      // Verificar respuesta
      IF !Empty( cResponse )
         msginfo( cResponse, "Respuesta del servidor:")
         msginfo(hb_ValToExp( oHTTP:hHeaders ),"oHTTP:hHeaders")
      ELSE
         msginfo(oClient:LastError(),"Error al enviar la solicitud POST:")
      ENDIF

      // Cerrar conexi贸n
      oClient:Close()
   ELSE
      msginfo(oClient:LastError(),"No se pudo conectar al servidor:")
   ENDIF

RETURN
y el error que se obtiene en ejecuci贸n para la l铆nea: LOCAL oClient := TIPClientHttp():New( cUrl ) // Inicializar el cliente HTTP
Application
===========
Path and name: c:\CLIWIN\FW\wintpv_64.exe (64 bits)
Size: 6,524,928 bytes
Compiler version: Harbour 3.2.0dev (r2503251254)
FiveWin version: FWH 25.01
C compiler version: Microsoft Visual C 19.32.31329 (64-bit)
Windows 10 64 Bits, version: 6.2, Build 9200

Time from start: 6 sec
Error occurred at: 14-10-25, 21:42:18
Error description: Error BASE/1081 Operaci垄n no soportada: TIPCLIENTHTTP:new()
Args:
[ 1] = O TIPCLIENTHTTP
[ 2] = C https

Stack Calls
===========
Called from: hbtip\client.prg => TIPCLIENT:NEW( 0 )
Called from: hbtip\httpcli.prg => TIPCLIENTHTTP:NEW( 0 )
Called from: wintpv.prg => PRUEBAHTTPS( 7 )
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
Re: TIPClientHttp() - ERROR
Posted: Tue Oct 14, 2025 09:09 PM

Yo probar铆a as铆:

...

LOCAL oClient := Nil

oClient := TIPClientHttp():New( cUrl ) // Inicializar el cliente HTTP

if oClient:Open()

....

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: TIPClientHttp() - ERROR
Posted: Wed Oct 15, 2025 07:31 AM

Probado, sigue dando el mismo fallo de operaci贸n no soportada.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: TIPClientHttp() - ERROR
Posted: Sat Oct 18, 2025 08:30 AM

You have to link hbssl.lib, libssl-3.lib and libcrypto-3.lib and put libssl-3.dll and libcrypto-3.dll in your directory (or in the path).

Continue the discussion