---
name: "WWW::OAuth::Request::HTTP_Request"
section: "3pm"
platform: "linux"
package: "libwww-oauth-perl"
version: "1.002-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/WWW::OAuth::Request::HTTP_Request"
---

# WWW::OAuth::Request::HTTP\_Request(3pm)

HTTP Request container for HTTP::Request

## NAME

WWW::OAuth::Request::HTTP\_Request - HTTP Request container for HTTP::Request

## SYNOPSIS

```
 my $req = WWW::OAuth::Request::HTTP_Request->new(request => $http_request);
 $req->request_with(LWP::UserAgent->new);
```

## DESCRIPTION

WWW::OAuth::Request::HTTP\_Request is a request container for WWW::OAuth that wraps a HTTP::Request object, which can be used by several user-agents like LWP::UserAgent, HTTP::Thin, and Net::Async::HTTP. It performs the role WWW::OAuth::Request.

## ATTRIBUTES

WWW::OAuth::Request::HTTP\_Request implements the following attributes.

### request

```
 my $http_request = $req->request;
 $req             = $req->request(HTTP::Request->new(GET => $url));
```

HTTP::Request object to authenticate.

## METHODS

WWW::OAuth::Request::HTTP\_Request composes all methods from WWW::OAuth::Request, and implements the following new ones.

### content

```
 my $content = $req->content;
 $req        = $req->content('foo=1&bar=2');
```

Set or return request content from "request".

### content\_is\_form

```
 my $bool = $req->content_is_form;
```

Check whether "request" has single-part content and a `"Content-Type"` header of `"application/x-www-form-urlencoded"`.

### header

```
 my $header = $req->header('Content-Type');
 $req       = $req->header(Authorization => 'Basic foobar');
```

Set or return a request header from "request".

### method

```
 my $method = $req->method;
 $req       = $req->method('GET');
```

Set or return request method from "request".

### request\_with

```
 $http_response = $req->request_with(LWP::UserAgent->new);
```

Run request with passed user-agent object, and return HTTP::Response object. User-agent may be LWP::UserAgent, HTTP::Thin, or Net::Async::HTTP. If run with Net::Async::HTTP, the return value is a Future yielding the HTTP::Response object as in "do\_request" in Net::Async::HTTP.

### url

```
 my $url = $req->url;
 $req    = $req->url('http://example.com/api/');
```

Set or return request URL from "request".

## BUGS

Report any issues on the public bugtracker.

## AUTHOR

Dan Book \<dbook@cpan.org\>

## COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Dan Book.

This is free software, licensed under:

```
  The Artistic License 2.0 (GPL Compatible)
```

## SEE ALSO

LWP::UserAgent, HTTP::Thin, Net::Async::HTTP
