Finance-Quote

 view release on metacpan or  search on metacpan

lib/Finance/Quote/UserAgent.pm  view on Meta::CPAN

# template headers if they have not already been set in the request.
sub request {
	my ($this, $request, @args) = @_;
	my $new_request = $this->_add_custom_headers($request);
	return $this->SUPER::request($new_request,@args);
}

# _add_custom_headers is a private method which does the dirty work
# of copying across headers and other fun things.
#
# We take the user-defined template, and then overlay the request over the
# top of it.  This should get us by in most situations.

sub _add_custom_headers {
	my ($this, $request) = @_;
	my $header_template = $this->default_headers;
	my $new_request = $request->clone; # Modifying the original is rude.

	# Copy things that are in the template that we don't have
	# defined in the request.



( run in 0.293 second using v1.01-cache-2.11-cpan-49f99fa48dc )