Newer Older
440 lines | 11.026kb
copy gitweblite soruce code
root authored on 2012-11-23
1
package Mojo::Message::Request;
2
use Mojo::Base 'Mojo::Message';
3

            
4
use Mojo::Cookie::Request;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
5
use Mojo::Util qw(b64_encode b64_decode get_line);
copy gitweblite soruce code
root authored on 2012-11-23
6
use Mojo::URL;
7

            
8
has env => sub { {} };
9
has method => 'GET';
10
has url => sub { Mojo::URL->new };
11

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
12
my $START_LINE_RE = qr/
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
13
  ^
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
14
  ([a-zA-Z]+)                                            # Method
copy gitweblite soruce code
root authored on 2012-11-23
15
  \s+
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
16
  ([0-9a-zA-Z!#\$\%&'()*+,\-.\/:;=?\@[\\\]^_`\{|\}~]+)   # URL
17
  (?:\s+HTTP\/(\d\.\d))?                                 # Version
copy gitweblite soruce code
root authored on 2012-11-23
18
  $
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
19
/x;
copy gitweblite soruce code
root authored on 2012-11-23
20

            
21
sub clone {
22
  my $self = shift;
23

            
24
  # Dynamic requests cannot be cloned
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
25
  return undef unless my $content = $self->content->clone;
copy gitweblite soruce code
root authored on 2012-11-23
26
  my $clone = $self->new(
27
    content => $content,
28
    method  => $self->method,
29
    url     => $self->url->clone,
30
    version => $self->version
31
  );
32
  $clone->{proxy} = $self->{proxy}->clone if $self->{proxy};
33

            
34
  return $clone;
35
}
36

            
37
sub cookies {
38
  my $self = shift;
39

            
40
  # Parse cookies
41
  my $headers = $self->headers;
42
  return [map { @{Mojo::Cookie::Request->parse($_)} } $headers->cookie]
43
    unless @_;
44

            
45
  # Add cookies
46
  my @cookies = $headers->cookie || ();
47
  for my $cookie (@_) {
48
    $cookie = Mojo::Cookie::Request->new($cookie) if ref $cookie eq 'HASH';
49
    push @cookies, $cookie;
50
  }
51
  $headers->cookie(join('; ', @cookies));
52

            
53
  return $self;
54
}
55

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
56
sub extract_start_line {
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
57
  my ($self, $bufref) = @_;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
58

            
59
  # Ignore any leading empty lines
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
60
  $$bufref =~ s/^\s+//;
61
  return undef unless defined(my $line = get_line $bufref);
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
62

            
63
  # We have a (hopefully) full request line
64
  $self->error('Bad request start line', 400) and return undef
65
    unless $line =~ $START_LINE_RE;
66
  my $url = $self->method($1)->version($3)->url;
67
  return !!($1 eq 'CONNECT' ? $url->authority($2) : $url->parse($2));
68
}
69

            
copy gitweblite soruce code
root authored on 2012-11-23
70
sub fix_headers {
71
  my $self = shift;
72
  $self->{fix} ? return $self : $self->SUPER::fix_headers(@_);
73

            
74
  # Basic authentication
75
  my $url     = $self->url;
76
  my $headers = $self->headers;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
77
  my $auth    = $url->userinfo;
78
  $headers->authorization('Basic ' . b64_encode($auth, ''))
79
    if $auth && !$headers->authorization;
copy gitweblite soruce code
root authored on 2012-11-23
80

            
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
81
  # Basic proxy authentication
copy gitweblite soruce code
root authored on 2012-11-23
82
  if (my $proxy = $self->proxy) {
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
83
    my $proxy_auth = $proxy->userinfo;
84
    $headers->proxy_authorization('Basic ' . b64_encode($proxy_auth, ''))
85
      if $proxy_auth && !$headers->proxy_authorization;
copy gitweblite soruce code
root authored on 2012-11-23
86
  }
87

            
88
  # Host
89
  my $host = $url->ihost;
90
  my $port = $url->port;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
91
  $headers->host($port ? "$host:$port" : $host) unless $headers->host;
copy gitweblite soruce code
root authored on 2012-11-23
92

            
93
  return $self;
94
}
95

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
96
sub get_start_line_chunk {
97
  my ($self, $offset) = @_;
98

            
99
  unless (defined $self->{start_buffer}) {
100

            
101
    # Path
102
    my $url   = $self->url;
103
    my $path  = $url->path->to_string;
104
    my $query = $url->query->to_string;
105
    $path .= "?$query" if $query;
106
    $path = "/$path" unless $path =~ m!^/!;
107

            
108
    # CONNECT
109
    my $method = uc $self->method;
110
    if ($method eq 'CONNECT') {
111
      my $port = $url->port || ($url->protocol eq 'https' ? '443' : '80');
112
      $path = $url->host . ":$port";
113
    }
114

            
115
    # Proxy
116
    elsif ($self->proxy) {
117
      my $clone = $url = $url->clone->userinfo(undef);
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
118
      my $upgrade = lc(defined $self->headers->upgrade ? $self->headers->upgrade : '');
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
119
      $path = $clone
120
        unless $upgrade eq 'websocket' || $url->protocol eq 'https';
121
    }
122

            
123
    $self->{start_buffer} = "$method $path HTTP/@{[$self->version]}\x0d\x0a";
124
  }
125

            
126
  $self->emit(progress => 'start_line', $offset);
127
  return substr $self->{start_buffer}, $offset, 131072;
128
}
129

            
copy gitweblite soruce code
root authored on 2012-11-23
130
sub is_secure {
131
  my $url = shift->url;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
132
  return ($url->protocol || $url->base->protocol) eq 'https';
copy gitweblite soruce code
root authored on 2012-11-23
133
}
134

            
135
sub is_xhr {
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
136
  (do {my $tmp = shift->headers->header('X-Requested-With'); defined $tmp ? $tmp : ''}) =~ /XMLHttpRequest/i;
copy gitweblite soruce code
root authored on 2012-11-23
137
}
138

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
139
sub param { shift->params->param(@_) }
copy gitweblite soruce code
root authored on 2012-11-23
140

            
141
sub params {
142
  my $self = shift;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
143
  return $self->{params}
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
144
    ||= $self->body_params->clone->merge($self->query_params);
copy gitweblite soruce code
root authored on 2012-11-23
145
}
146

            
147
sub parse {
148
  my $self = shift;
149

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
150
  # Parse CGI environment
151
  my $env = @_ > 1 ? {@_} : ref $_[0] eq 'HASH' ? $_[0] : undef;
152
  $self->env($env)->_parse_env($env) if $env;
copy gitweblite soruce code
root authored on 2012-11-23
153

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
154
  # Parse normal message
155
  my @args = $env ? () : @_;
156
  if ((defined $self->{state} ? $self->{state} : '') ne 'cgi') { $self->SUPER::parse(@args) }
copy gitweblite soruce code
root authored on 2012-11-23
157

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
158
  # Parse CGI content
159
  else { $self->content($self->content->parse_body(@args))->SUPER::parse }
copy gitweblite soruce code
root authored on 2012-11-23
160

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
161
  # Check if we can fix things that require all headers
162
  return $self unless $self->is_finished;
copy gitweblite soruce code
root authored on 2012-11-23
163

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
164
  # Base URL
165
  my $base = $self->url->base;
166
  $base->scheme('http') unless $base->scheme;
167
  my $headers = $self->headers;
168
  if (!$base->host && (my $host = $headers->host)) { $base->authority($host) }
copy gitweblite soruce code
root authored on 2012-11-23
169

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
170
  # Basic authentication
171
  my $auth = _parse_basic_auth($headers->authorization);
172
  $base->userinfo($auth) if $auth;
copy gitweblite soruce code
root authored on 2012-11-23
173

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
174
  # Basic proxy authentication
175
  my $proxy_auth = _parse_basic_auth($headers->proxy_authorization);
176
  $self->proxy(Mojo::URL->new->userinfo($proxy_auth)) if $proxy_auth;
copy gitweblite soruce code
root authored on 2012-11-23
177

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
178
  # "X-Forwarded-HTTPS"
179
  $base->scheme('https')
180
    if $ENV{MOJO_REVERSE_PROXY} && $headers->header('X-Forwarded-HTTPS');
copy gitweblite soruce code
root authored on 2012-11-23
181

            
182
  return $self;
183
}
184

            
185
sub proxy {
186
  my $self = shift;
187
  return $self->{proxy} unless @_;
188
  $self->{proxy} = !$_[0] || ref $_[0] ? shift : Mojo::URL->new(shift);
189
  return $self;
190
}
191

            
192
sub query_params { shift->url->query }
193

            
194
sub _parse_basic_auth {
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
195
  return undef unless my $header = shift;
196
  return $header =~ /Basic (.+)$/ ? b64_decode($1) : undef;
copy gitweblite soruce code
root authored on 2012-11-23
197
}
198

            
199
sub _parse_env {
200
  my ($self, $env) = @_;
201

            
202
  # Extract headers
203
  my $headers = $self->headers;
204
  my $url     = $self->url;
205
  my $base    = $url->base;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
206
  while (my ($name, $value) = each %$env) {
207
    next unless $name =~ s/^HTTP_//i;
copy gitweblite soruce code
root authored on 2012-11-23
208
    $name =~ s/_/-/g;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
209
    $headers->header($name => $value);
copy gitweblite soruce code
root authored on 2012-11-23
210

            
211
    # Host/Port
212
    if ($name eq 'HOST') {
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
213
      my ($host, $port) = ($value, undef);
214
      ($host, $port) = ($1, $2) if $host =~ /^([^:]*):?(.*)$/;
copy gitweblite soruce code
root authored on 2012-11-23
215
      $base->host($host)->port($port);
216
    }
217
  }
218

            
219
  # Content-Type is a special case on some servers
220
  $headers->content_type($env->{CONTENT_TYPE}) if $env->{CONTENT_TYPE};
221

            
222
  # Content-Length is a special case on some servers
223
  $headers->content_length($env->{CONTENT_LENGTH}) if $env->{CONTENT_LENGTH};
224

            
225
  # Query
226
  $url->query->parse($env->{QUERY_STRING}) if $env->{QUERY_STRING};
227

            
228
  # Method
229
  $self->method($env->{REQUEST_METHOD}) if $env->{REQUEST_METHOD};
230

            
231
  # Scheme/Version
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
232
  if ((defined $env->{SERVER_PROTOCOL} ? $env->{SERVER_PROTOCOL} : '') =~ m!^([^/]+)/([^/]+)$!) {
copy gitweblite soruce code
root authored on 2012-11-23
233
    $base->scheme($1);
234
    $self->version($2);
235
  }
236

            
237
  # HTTPS
238
  $base->scheme('https') if $env->{HTTPS};
239

            
240
  # Path
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
241
  my $path = $url->path->parse($env->{PATH_INFO} ? $env->{PATH_INFO} : '');
copy gitweblite soruce code
root authored on 2012-11-23
242

            
243
  # Base path
244
  if (my $value = $env->{SCRIPT_NAME}) {
245

            
246
    # Make sure there is a trailing slash (important for merging)
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
247
    $base->path->parse($value =~ m!/$! ? $value : "$value/");
copy gitweblite soruce code
root authored on 2012-11-23
248

            
249
    # Remove SCRIPT_NAME prefix if necessary
250
    my $buffer = $path->to_string;
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
251
    $value =~ s!^/|/$!!g;
252
    $buffer =~ s!^/?\Q$value\E/?!!;
253
    $buffer =~ s!^/!!;
copy gitweblite soruce code
root authored on 2012-11-23
254
    $path->parse($buffer);
255
  }
256

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
257
  # Bypass normal message parser
258
  $self->{state} = 'cgi';
copy gitweblite soruce code
root authored on 2012-11-23
259
}
260

            
261
1;
262

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
263
=encoding utf8
264

            
copy gitweblite soruce code
root authored on 2012-11-23
265
=head1 NAME
266

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
267
Mojo::Message::Request - HTTP request
copy gitweblite soruce code
root authored on 2012-11-23
268

            
269
=head1 SYNOPSIS
270

            
271
  use Mojo::Message::Request;
272

            
273
  # Parse
274
  my $req = Mojo::Message::Request->new;
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
275
  $req->parse("GET /foo HTTP/1.0\x0d\x0a");
276
  $req->parse("Content-Length: 12\x0d\x0a");
277
  $req->parse("Content-Type: text/plain\x0d\x0a\x0d\x0a");
copy gitweblite soruce code
root authored on 2012-11-23
278
  $req->parse('Hello World!');
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
279
  say $req->method;
280
  say $req->headers->content_type;
copy gitweblite soruce code
root authored on 2012-11-23
281
  say $req->body;
282

            
283
  # Build
284
  my $req = Mojo::Message::Request->new;
285
  $req->url->parse('http://127.0.0.1/foo/bar');
286
  $req->method('GET');
287
  say $req->to_string;
288

            
289
=head1 DESCRIPTION
290

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
291
L<Mojo::Message::Request> is a container for HTTP requests as described in RFC
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
292
2616 and RFC 2817.
copy gitweblite soruce code
root authored on 2012-11-23
293

            
294
=head1 EVENTS
295

            
296
L<Mojo::Message::Request> inherits all events from L<Mojo::Message>.
297

            
298
=head1 ATTRIBUTES
299

            
300
L<Mojo::Message::Request> inherits all attributes from L<Mojo::Message> and
301
implements the following new ones.
302

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
303
=head2 env
copy gitweblite soruce code
root authored on 2012-11-23
304

            
305
  my $env = $req->env;
306
  $req    = $req->env({});
307

            
308
Direct access to the C<CGI> or C<PSGI> environment hash if available.
309

            
310
  # Check CGI version
311
  my $version = $req->env->{GATEWAY_INTERFACE};
312

            
313
  # Check PSGI version
314
  my $version = $req->env->{'psgi.version'};
315

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
316
=head2 method
copy gitweblite soruce code
root authored on 2012-11-23
317

            
318
  my $method = $req->method;
319
  $req       = $req->method('POST');
320

            
321
HTTP request method, defaults to C<GET>.
322

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
323
=head2 url
copy gitweblite soruce code
root authored on 2012-11-23
324

            
325
  my $url = $req->url;
326
  $req    = $req->url(Mojo::URL->new);
327

            
328
HTTP request URL, defaults to a L<Mojo::URL> object.
329

            
update Mojolicious 4.07
Yuki Kimoto authored on 2013-06-03
330
  # Get request information
331
  say $req->url->to_abs->userinfo;
332
  say $req->url->to_abs->host;
333
  say $req->url->to_abs->path;
copy gitweblite soruce code
root authored on 2012-11-23
334

            
335
=head1 METHODS
336

            
337
L<Mojo::Message::Request> inherits all methods from L<Mojo::Message> and
338
implements the following new ones.
339

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
340
=head2 clone
copy gitweblite soruce code
root authored on 2012-11-23
341

            
342
  my $clone = $req->clone;
343

            
344
Clone request if possible, otherwise return C<undef>.
345

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
346
=head2 cookies
copy gitweblite soruce code
root authored on 2012-11-23
347

            
348
  my $cookies = $req->cookies;
349
  $req        = $req->cookies(Mojo::Cookie::Request->new);
350
  $req        = $req->cookies({name => 'foo', value => 'bar'});
351

            
352
Access request cookies, usually L<Mojo::Cookie::Request> objects.
353

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
354
=head2 extract_start_line
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
355

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
356
  my $bool = $req->extract_start_line(\$str);
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
357

            
358
Extract request line from string.
copy gitweblite soruce code
root authored on 2012-11-23
359

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
360
=head2 fix_headers
copy gitweblite soruce code
root authored on 2012-11-23
361

            
362
  $req = $req->fix_headers;
363

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
364
Make sure request has all required headers.
365

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
366
=head2 get_start_line_chunk
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
367

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
368
  my $bytes = $req->get_start_line_chunk($offset);
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
369

            
370
Get a chunk of request line data starting from a specific position.
copy gitweblite soruce code
root authored on 2012-11-23
371

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
372
=head2 is_secure
copy gitweblite soruce code
root authored on 2012-11-23
373

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
374
  my $bool = $req->is_secure;
copy gitweblite soruce code
root authored on 2012-11-23
375

            
376
Check if connection is secure.
377

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
378
=head2 is_xhr
copy gitweblite soruce code
root authored on 2012-11-23
379

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
380
  my $bool = $req->is_xhr;
copy gitweblite soruce code
root authored on 2012-11-23
381

            
382
Check C<X-Requested-With> header for C<XMLHttpRequest> value.
383

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
384
=head2 param
copy gitweblite soruce code
root authored on 2012-11-23
385

            
386
  my @names = $req->param;
387
  my $foo   = $req->param('foo');
388
  my @foo   = $req->param('foo');
389

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
390
Access GET and POST parameters. Note that this method caches all data, so it
391
should not be called before the entire request body has been received. Parts
392
of the request body need to be loaded into memory to parse POST parameters, so
393
you have to make sure it is not excessively large.
copy gitweblite soruce code
root authored on 2012-11-23
394

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
395
=head2 params
copy gitweblite soruce code
root authored on 2012-11-23
396

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
397
  my $params = $req->params;
copy gitweblite soruce code
root authored on 2012-11-23
398

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
399
All GET and POST parameters, usually a L<Mojo::Parameters> object. Note that
400
this method caches all data, so it should not be called before the entire
401
request body has been received. Parts of the request body need to be loaded
402
into memory to parse POST parameters, so you have to make sure it is not
403
excessively large.
copy gitweblite soruce code
root authored on 2012-11-23
404

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
405
  # Get parameter value
copy gitweblite soruce code
root authored on 2012-11-23
406
  say $req->params->param('foo');
407

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
408
=head2 parse
copy gitweblite soruce code
root authored on 2012-11-23
409

            
410
  $req = $req->parse('GET /foo/bar HTTP/1.1');
411
  $req = $req->parse(REQUEST_METHOD => 'GET');
412
  $req = $req->parse({REQUEST_METHOD => 'GET'});
413

            
414
Parse HTTP request chunks or environment hash.
415

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
416
=head2 proxy
copy gitweblite soruce code
root authored on 2012-11-23
417

            
418
  my $proxy = $req->proxy;
419
  $req      = $req->proxy('http://foo:bar@127.0.0.1:3000');
420
  $req      = $req->proxy(Mojo::URL->new('http://127.0.0.1:3000'));
421

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
422
Proxy URL for request.
copy gitweblite soruce code
root authored on 2012-11-23
423

            
424
  # Disable proxy
425
  $req->proxy(0);
426

            
update Mojolicious and added...
Yuki Kimoto authored on 2013-03-20
427
=head2 query_params
copy gitweblite soruce code
root authored on 2012-11-23
428

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
429
  my $params = $req->query_params;
copy gitweblite soruce code
root authored on 2012-11-23
430

            
update Mojolicious to 4.57
Yuki Kimoto authored on 2013-12-02
431
All GET parameters, usually a L<Mojo::Parameters> object.
copy gitweblite soruce code
root authored on 2012-11-23
432

            
upgraded Mojolicious to v3.7...
Yuki Kimoto authored on 2013-01-28
433
  # Turn GET parameters to hash and extract value
434
  say $req->query_params->to_hash->{foo};
copy gitweblite soruce code
root authored on 2012-11-23
435

            
436
=head1 SEE ALSO
437

            
438
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
439

            
440
=cut