Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
HTTP::Engine::Test::ReUsertContributed Perl DocuHTTP::Engine::Test::Request(3)

NAME
       HTTP::Engine::Test::Request - HTTP::Engine request object builder for
       test

SYNOPSIS
	   use HTTP::Engine::Test::Request;

	   # simple query
	   my $req = HTTP::Engine::Test::Request->new(
	       uri => 'http://example.com/?foo=bar&bar=baz'
	   );
	   is $req->method, 'GET', 'GET	method';
	   is $req->address, '127.0.0.1', 'remote address';
	   is $req->uri, 'http://example.com/?foo=bar&bar=baz',	'uri';
	   is_deeply $req->parameters, { foo =>	'bar', bar => 'baz' }, 'query params';

	   # use headers
	   my $req = HTTP::Engine::Test::Request->new(
	       uri     => 'http://example.com/',
	       headers => {
		   'Content-Type' => 'text/plain',
	       },
	   );
	   is $req->header('content-type'), 'text/plain', 'content-type';

	   # by	HTTP::Request object
	   my $req = HTTP::Engine::Test::Request->new(
	       HTTP::Request->new(
		   GET => 'http://example.com/?foo=bar&bar=baz',
		   HTTP::Headers::Fast->new(
		       'Content-Type' => 'text/plain',
		   ),
	       )
	   );

	   is $req->method, 'GET', 'GET	method';
	   is $req->address, '127.0.0.1', 'remote address';
	   is $req->uri, 'http://example.com/?foo=bar&bar=baz',	'uri';
	   is_deeply $req->parameters, { foo =>	'bar', bar => 'baz' }, 'query params';
	   is $req->header('content-type'), 'text/plain', 'content-type';

DESCRIPTION
       HTTP::Engine::Test::Request is HTTP::Engine request object builder.

       Please use in a your test.

SEE ALSO
       HTTP::Engine::Request

AUTHOR
       Kazuhiro	Osawa <ko@yappo.ne.jp>

perl v5.32.0			  2011-10-04	HTTP::Engine::Test::Request(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=HTTP::Engine::Test::Request&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help