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? 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]"); Link to comment https://forums.phpfreaks.com/topic/127960-401-authorization-using-curl/#findComment-662603 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.