---
name: "OAuth::Lite2::ParamMethod::FormEncodedBody"
section: "3pm"
platform: "linux"
package: "liboauth-lite2-perl"
version: "0.11-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/OAuth::Lite2::ParamMethod::FormEncodedBody"
---

# OAuth::Lite2::ParamMethod::FormEncodedBody(3pm)

builder/parser for OAuth 2.0 FormEncodedBody type of parameter

## NAME

OAuth::Lite2::ParamMethod::FormEncodedBody - builder/parser for OAuth 2.0 FormEncodedBody type of parameter

## SYNOPSIS

```
    my $meth = OAuth::Lite2::ParamMethod::FormEncodedBody->new;
    # server side
    if ($meth->match( $plack_request )) {
        my ($token, $params) = $meth->parse( $plack_request );
    }
    # client side
    my $http_req = $meth->request_builder(...);
```

## DESCRIPTION

builder/parser for OAuth 2.0 FormEncodedBody type of parameter

## METHODS

### new

Constructor

### match( $plack\_request )

Returns true if passed Plack::Request object is matched for the type of this method.

```
    if ( $meth->match( $plack_request ) ) {
        ...
    }
```

### parse( $plack\_request )

Parse the Plack::Request, and returns access token and oauth parameters.

```
    my ($token, $params) = $meth->parse( $plack_request );
```

### build\_request( %params )

Build HTTP::Request object.

```
    my $req = $meth->build_request(
        url          => $url,
        method       => $http_method,
        token        => $access_token,
        oauth_params => $oauth_params,
        params       => $params,
        content      => $content,
        headers      => $headers,
    );
```

### is\_legacy( $plack\_request )

Returns true if passed Plack::Request object is based draft version 10.

```
    if ( $meth->is_legacy( $plack_request ) ) {
        ...
    }
```

## SEE ALSO

OAuth::Lite2::ParamMethods OAuth::Lite2::ParamMethod OAuth::Lite2::ParamMethod::AuthHeader OAuth::Lite2::ParamMethod::URIQueryParameter

## AUTHOR

Lyo Kato, \<lyo.kato@gmail.com\>

## COPYRIGHT AND LICENSE

Copyright (C) 2010 by Lyo Kato

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
