How to curl login authentication like this

683 Views Asked by At

I want to login curl with php or another language

example site : http://192.168.1.1/cgi-bin/mystatus.cgi

when curl site will alert authentication below picture how to sign in for retrieve data

enter image description here

1

There are 1 best solutions below

1
Ominousness On

This is called HTTP Basic Authentication.

In order to authenticate use the CURLOPT_USERPWD option.

curl_setopt($curl, CURLOPT_USERPWD, "USERNAME:PASSWORD");