Page 2 of 2

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

PostPosted: Sun Nov 06, 2022 1:59 pm
by leandro
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()
 

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

PostPosted: Mon Nov 07, 2022 2:30 pm
by cnavarro
Leandro, contacta conmigo por mail o skype