set_useragent ( $ua )

Sets a custom useragent string for the class.

Access

public

Parameters

Parameter

Type

Required

Description

$ua

string

Required

The useragent string to use.

Returns

Type

Description

$this

A reference to the current instance.

Examples

Set a useragent string to use for HTTP requests.

$http = new RequestCore('http://github.com/skyzyx/requestcore/raw/master/_tests/test_request.txt');
$http->set_useragent('SampleUserAgentString');

var_dump($http->useragent);
Result:
string(21) "SampleUserAgentString"

Source

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback