Re: Get the User-Agent string?

Tom Worster <[email protected]>
Newsgroups gmane.comp.web.curl.php
Message-ID <C901BA7B.9CE6%[email protected]>
Curl does things like this:

GET / HTTP/1.1
User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7
OpenSSL/0.9.8l zlib/1.2.3
Host: 127.0.0.1:12345
Accept: */*


That's a swell User-Agent value. Very informative.

In my application, I want to send an informative User-Agent such as this
but modified to identify also my application. Hence I want to find the
proper UA string for the php curl instance on the server so that I can
manipulate it.

So can I read such a string value in a PHP script?

On other words: We are given a UA setter curl_setopt(,
CURLOPT_USERAGENT,). Is there a corresponding UA getter?

Tom


On 11/11/10 3:02 PM, "Andrey Kuznetsov" <[email protected]> wrote:

>You are unclear about what you mean, sending HTTP GET to oneself, what
>does that mean?
>
>If you want to send the useragent of the browser that is running the
>script the use $_SERVER['HTTP_USER_AGENT'] value.
>
>On Thu, Nov 11, 2010 at 11:54 AM, Tom Worster <[email protected]> wrote:
>> We can set the User-Agent string that cURL will use with
>>
>>  curl_setopt($handle, CURLOPT_USERAGENT, 'Something');
>>
>> But is there a way to get this this string value without sending an HTTP
>> GET to oneself?
>>
>> Tom
>>
>>
>> _______________________________________________
>> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>
>
>
>
>-- 
>Andrey
>_______________________________________________
>http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php


_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.