php - Http Basic Authentication using Laravel Curl Library -


i using https://github.com/ixudra/curl curl library laravel know how run below command through curl library;

curl_setopt($process, curlopt_userpwd, $username . ":" . $password); 

i need curl url using http basic authentication , cant seem complete using library.

your post quite old, looking same thing. have use method withoption :

 $response = curl::to('https://your-url.com')                        ->withoption('userpwd', 'user:password')                        ->post(); 

if want use other curl option, have remove prefix "curlopt_".


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -