|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-03-05 20:59 UTC] narf at devilix dot net
[2016-04-24 03:21 UTC] pierrick@php.net
-Status: Open
+Status: Wont fix
[2016-04-24 03:21 UTC] pierrick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
Description: ------------ When calling curl from command-line, unless specified otherwise it sets by default the User Agent to 'curl/x.y.z'. It would be nice if the php curl extension did the same thing (at the moment, the user agent is set to blank), to avoid having to do something like $v = curl_version(); curl_setopt( $curl, CURLOPT_USERAGENT, 'curl/' . $v['version'] ); Test script: --------------- $ curl localhost ==> access.log ::1 - - [26/Apr/2013:16:54:52 +0200] "GET / HTTP/1.1" 200 1665 "-" "curl/7.27.0" $ php -a php > $c = curl_init('localhost'); php > curl_exec($c); ==> access.log ::1 - - [26/Apr/2013:16:53:15 +0200] "GET / HTTP/1.1" 200 1665 "-" "-"