Welcome Guest, Not a member yet? Register   Sign In
Curl best practice for API calls? Protecting sensitive data like API keys
#3

(This post was last modified: 06-19-2024, 04:57 PM by minsk832.)

Thank you: Here I read: https://www.codeigniter.com/user_guide/l...ng-options

Quote:"Since v4.4.0, the default value has been changed to false."

system/Config/Service.php


PHP Code:
    /**
    * The CURL Request class acts as a simple HTTP client for interacting
    * with other servers, typically through APIs.
    *
    * @return CURLRequest
    */
    public static function curlrequest(array $options = [], ?ResponseInterface $response null, ?App $config nullbool $getShared true)
    {
        if ($getShared === true) {
            return static::getSharedInstance('curlrequest'$options$response$config);
        }

        $config ??= config(App::class);
        $response ??= new Response($config);

        return new CURLRequest(
            $config,
            new URI($options['base_uri'] ?? null),
            $response,
            $options
        
);
    


So there is no need to specifically use single_service() in my libraries that use curl requests? The options for curl requests passed to the constructor are usually not shared?
Reply


Messages In This Thread
RE: Curl best practice for API calls? Protecting sensitive data like API keys - by minsk832 - 06-19-2024, 04:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB