首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > RESTful API框架/ mod_perl2 apache2

RESTful API框架/ mod_perl2 apache2

  • 资源大小:18.62 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 框架 RESTfulAPI modperlapache

资 源 简 介

Apache2::REST provides a simple and flexible micro-framework which allows developers to implement their application RESTful"s API in Perl, using apache2 and mod_perl2/mod_apreq2. Find the code and more documentation at CPAN Here"s a quick tutorial: 1. Install it $ cpan -i Apache2::REST 2. Write your first API root handler ``` package MyApp::REST::API ; use warnings ; use strict ; use base qw/Apache2::REST::Handler/ ; Implement the GET HTTP method. sub GET{ my ($self, $request, $response) = @_ ; $response->data()->{’api_mess’} = ’Hello, this is MyApp REST API’ ; return Apache2::Const::HTTP_OK ; } # Authorize the GET method. sub isAuth{my ($self, $method, $req) = @_; return $method eq ’GET’;} 1 ; ``` 3. Configure apache # Make sure youLoadModule apreq_module modules/mod_apreq2.soLoadModule perl_module modules/mod_perl.so# Load Apache2::RESTPerlModule Apache2:

文 件 列 表

Apache2-REST-0.05
bin
lib
README
Makefile.PL
MANIFEST
Changes
META.yml
t
VIP VIP
  • Mason 28分钟前 成为了本站会员

  • 58分钟前 成为了本站会员

  • Half_Punch 1天前 成为了本站会员

  • liqing71718 1天前 成为了本站会员

  • 伟国 1天前 成为了本站会员

  • songy 1天前 成为了本站会员

  • 纯色幽默 1天前 成为了本站会员

  • odd? 1天前 成为了本站会员

  • 52JOY... 1天前 成为了本站会员

  • Sirius 2天前 成为了本站会员

0.176390s