siddscool19 Posted October 11, 2008 Share Posted October 11, 2008 401 Authorization using curl? how can we do that? I mean how to send data to a 401 Authorization? Quote Link to comment https://forums.phpfreaks.com/topic/127960-401-authorization-using-curl/ Share on other sites More sharing options...
Guest Posted October 11, 2008 Share Posted October 11, 2008 Try this, it should work for basic HTTP authentication. // Of course, change these: $url = '...'; $username = 'myname'; $password = '123'; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl, CURLOPT_USERPWD, "[$username]:[$password]"); Quote Link to comment https://forums.phpfreaks.com/topic/127960-401-authorization-using-curl/#findComment-662603 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.