---
name: "MetaCPAN::Client::Role::HasUA"
section: "3pm"
platform: "linux"
package: "libmetacpan-client-perl"
version: "2.033000-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/MetaCPAN::Client::Role::HasUA"
---

# MetaCPAN::Client::Role::HasUA(3pm)

Role for supporting user-agent attribute

## NAME

MetaCPAN::Client::Role::HasUA - Role for supporting user-agent attribute

## VERSION

version 2.033000

## ATTRIBUTES

### ua

```
    my $mcpan = MetaCPAN::Client->new( ua => HTTP::Tiny->new(...) );
```

The user agent object for running requests.

It must provide an interface that matches HTTP::Tiny. Explicitly:

- •

  Implement **post()**

  Method `"post"` must be available that accepts a request URL and a hashref of options.

- •

  Implement **get()**

  Method `"get"` must be available that accepts a request URL.

- •

  Return result hashref

  Must return a result hashref which has key `"success"` and key `"content"`.

Default: HTTP::Tiny,

### ua\_args

```
    my $mcpan = MetaCPAN::Client->new(
        ua_args => [ agent => 'MyAgent' ],
    );
```

Arguments sent to the user agent.

Default: user agent string: **MetaCPAN::Client/$version**.

## AUTHORS

- •

  Sawyer X \<xsawyerx@cpan.org\>

- •

  Mickey Nasriachi \<mickey@cpan.org\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Sawyer X.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
