Capturar el motivo del error petición web (curl)

Re: Capturar el motivo del error petición web (curl)

Postby leandro » Sun Nov 06, 2022 1:59 pm

Amigo gracias por responder pero nada :(
Ahora esta devolviendo el error
Code: Select all  Expand view

SSL connect error
 

Code: Select all  Expand view
            curl_global_init()
            oCurl := curl_easy_init()
            if !empty( oCurl )
                curl_easy_setopt( oCurl, HB_CURLOPT_DEFAULT_PROTOCOL, "https" )
                curl_easy_setopt( oCurl, HB_CURLOPT_URL, ::urlenvio )
                AAdd( aHeaders, "authorization: Basic "+cBas64 )
                AAdd( aHeaders, "content-type : application/json" )  
                AAdd( aHeaders, "cache-control : no-cache" )  
                curl_easy_setopt( oCurl, HB_CURLOPT_HTTPHEADER, aHeaders )
                curl_easy_setopt( oCurl, HB_CURLOPT_CONNECTTIMEOUT , 100 )
                curl_easy_setopt( oCurl, HB_CURLOPT_POST, 1)
                //curl_easy_setopt( oCurl, HB_CURLOPT_CUSTOMREQUEST, "POST")
                curl_easy_setopt( oCurl, HB_CURLOPT_POSTFIELDS, ::cdnaJson )
                curl_easy_setopt( oCurl, HB_CURLOPT_SSL_VERIFYHOST, .F. )
                curl_easy_setopt( oCurl, HB_CURLOPT_SSL_VERIFYPEER, .F. )
                curl_easy_setopt( oCurl, HB_CURLOPT_DL_BUFF_SETUP )
                curl_easy_setopt( oCurl, HB_CURLOPT_ENCODING, "UTF-8" )

                cError := curl_easy_perform( oCurl )
                if !Empty( cError )
                    MsgInfo( curl_easy_strerror( cError ), "Error" )
                endif
                cTexto  := curl_easy_dl_buff_get( oCurl )
                fw_memoedit( cTexto ) //Creo que aqui viene la respuesta
                curl_easy_reset( oCurl )
            endif
            curl_global_cleanup()
 
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Embarcadero C++ 7.60 for Win32 ] [ FiveWin 23.07 ] [ xHarbour 1.3.0 Intl. (SimpLex) (Build 20230914) ]
User avatar
leandro
 
Posts: 1488
Joined: Wed Oct 26, 2005 2:49 pm
Location: Colombia

Re: Capturar el motivo del error petición web (curl)

Postby cnavarro » Mon Nov 07, 2022 2:30 pm

Leandro, contacta conmigo por mail o skype
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 37 guests