nategood / httpful

A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.
MIT License
1.74k stars 299 forks source link

not work in php 5.3.1 #302

Closed arcanisgk closed 1 year ago

arcanisgk commented 1 year ago

hello i have a client runing a full system under php5.3.1

but when i try to implement your librery like:

<?php
require_once 'pac/httpful.phar';

class Servicio_pac {

    public function CertificarJson($Json_envio,$usuario_api,$llave_api,$llave_firma,$identificador)
    {

        $url_servicio_fel = "Some URL";

        try{
            $response = Request::post($url_servicio_fel)
                    ->sendsJson()                               
                    ->body($Json_envio)
                    ->addHeaders(array(
                          'usuario-api' => $usuario_api,             
                          'llave-api' => $llave_api, 
                          "llave-firma" => $llave_firma,
                   "identificador"=>$identificador          
                            ))         
                        ->send();

            return (json_encode($response->body));

        }catch(Exception $error){
            echo("Error al enviar: ");
            return null;
        }
    }
 }

i get error:

Fatal error: Class 'Httpful\Request' not found in /opt/lampp/htdocs/index.php on line 13

quasipickle commented 1 year ago

This library requires PHP 7.2+