Group
Extension

Matches 4

Net-OATH-Server ( R/RI/RITOU/Net-OATH-Server-0.02.tar.gz, RITOU, 2014; MetaCPAN )
Net-OATH-Server/lib/Net/OATH/Server/Lite.pm ( view source; MetaCPAN )
: localhost
    Content-Type: application/json

    {
     "method":"create"
    }

    ## response
    HTTP/1.1 201 Created
    Content-Type: application/json;charset=UTF-8
    Cache-Control: no-stor
Type: application/json

    {
     "method":"read",
     "id":"81c8feb9b54f632823fafea71966b5f89ad5cc92"
    }

    ## response
    HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
   
cation/json

    {
     "method":"update",
     "id":"81c8feb9b54f632823fafea71966b5f89ad5cc92",
     "type":"hotp"
    }

    ## response
    HTTP/1.1 200 OK
    Content-Type: application/json;charse
Net-OATH-Server ( R/RI/RITOU/Net-OATH-Server-0.02.tar.gz, RITOU, 2014; MetaCPAN )
Net-OATH-Server/lib/Net/OATH/Server/Lite/Endpoint/User.pm ( view source; MetaCPAN )
 => 1;

use Try::Tiny qw/try catch/;
use Plack::Request;
use Params::Validate;
use JSON::XS qw/decode_json encode_json/;
use Convert::Base32 qw/encode_base32/;

use Net::OATH::Server::Lite::Error;
use
s ($request->method eq q{POST});

        # content MUST be JSON
        my $content = {};
        eval {
            $content = decode_json($request->content) if $request->content;
        };
       
Content-Type"  => "application/json;charset=UTF-8",
              "Cache-Control" => "no-store",
              "Pragma"        => "no-cache" ],
            [ encode_json($params) ]);
    } catch {
   
Net-OATH-Server ( R/RI/RITOU/Net-OATH-Server-0.02.tar.gz, RITOU, 2014; MetaCPAN )
Net-OATH-Server/lib/Net/OATH/Server/Lite/Endpoint/Login.pm ( view source; MetaCPAN )
 => 1;

use Try::Tiny qw/try catch/;
use Plack::Request;
use Params::Validate;
use JSON::XS qw/decode_json encode_json/;

use Net::OATH::Server::Lite::Login;
use Net::OATH::Server::Lite::Error;

sub n
s ($request->method eq q{POST});

        my $params;
        eval {
            $params = decode_json($request->content);
        };
        Net::OATH::Server::Lite::Error->throw() unless $params;

 
t-Type"  => "application/json;charset=UTF-8",
                  "Cache-Control" => "no-store",
                  "Pragma"        => "no-cache" ],
                [ encode_json($response_params) ]);
  
Net-OATH-Server ( R/RI/RITOU/Net-OATH-Server-0.02.tar.gz, RITOU, 2014; MetaCPAN )
Net-OATH-Server/lib/Net/OATH/Server/Lite/Error.pm ( view source; MetaCPAN )
:Lite::Error;

    # default error
    # HTTP/1.1 400 Bad Request
    # Content-Type: application/json;charset=UTF-8
    # Cache-Control: no-store
    # Pragma: no-cache
    #
    # {
    #   "error":
->throw() if ...

    # custom error
    # HTTP/1.1 404 Not Found
    # Content-Type: application/json;charset=UTF-8
    # Cache-Control: no-store
    # Pragma: no-cache
    #
    # {
    #   "error":

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.