Branch Coverage

blib/lib/HTTP/API/Client.pm
Criterion Covered Total %
branch 80 130 61.5


line true false branch
161 21 9 if ($content_type)
167 9 0 if ($method eq 'GET')
196 6 0 if ($engine eq 'LWP::UserAgent') { }
346 0 89 unless defined $callback
347 73 16 unless UNIVERSAL::isa($callback, 'CODE')
362 6 4 $base_url ? :
370 10 0 if (my $pd = $self->pre_defined_data)
374 10 0 if (my $ph = $self->pre_defined_headers)
378 10 0 if (my $pe = $self->pre_defined_events)
400 10 0 if ($eng eq 'LWP::UserAgent')
403 10 0 if ($events->{'test_request_object'})
410 0 0 if ($debug{'in_out'} or $debug{'send_out'})
412 0 0 if ($retry_count and $retry)
422 0 0 if $debug{'response_if_fail'} and $response->is_success
424 0 0 if ($debug_response)
430 0 0 $debug{'response_header_only'} ? :
437 0 0 if $response->is_success
439 0 0 unless (%retry_status)
445 0 0 unless my $pattern = $retry_status{$response->code}
450 0 0 if ($response->decode_content =~ /$pattern/)
479 0 0 unless my $content = $self->last_response->decoded_content
500 9 1 if ($content)
501 9 0 if ($self->charset eq 'utf8')
508 5 5 if ($method eq 'GET') { }
5 0 elsif ($content) { }
509 0 5 if ($content_type ne 'application/x-www-form-urlencoded') { }
4 1 elsif ($content) { }
513 0 4 if ($url =~ /\?/) { }
534 0 10 if (my $do = $events->{'before_headers'})
540 0 10 if (my $keys = $events->{'headers_keys'}) { }
0 10 elsif (my $add = $events->{'add_headers_keys'}) { }
551 0 2 if (my $do = $events->{'before_header'}{$key})
555 0 2 if $o{'skip_headers'}{$key} or not exists $headers->{$key} or not defined $headers->{$key}
559 0 2 if (my $do = $events->{'after_header'}{$key})
564 1 9 if (my $do = $events->{'after_header_keys'})
585 1 9 if ($u or $p) { }
0 9 elsif ($at) { }
605 0 0 if ($error =~ /content must be bytes/)
619 3 7 if ($content_type =~ /json/) { }
7 0 elsif ($content_type eq 'application/x-www-form-urlencoded') { }
637 1 2 if (my $do = $events->{'keys'}) { }
647 0 14 if ($events->{'not_include'}{$key})
650 0 14 if $o{'skip_key'}{$key} or not exists $data->{$key} or not defined $data->{$key}
662 5 38 if (UNIVERSAL::isa($v, 'CODE'))
666 26 17 if (not ref $v) { }
6 11 elsif (ref $v eq 'BOOL') { }
9 2 elsif (UNIVERSAL::isa($v, 'ARRAY')) { }
2 0 elsif (UNIVERSAL::isa($v, 'HASH')) { }
667 26 0 &looks_like_number($v) ? :
701 0 8 if (my $do = $events->{'before_sorting_keys'})
705 2 6 if (my $do = $events->{'keys'}) { }
712 0 8 if (my $do = $events->{'after_sorting_keys'})
719 0 40 if $o{'skip_key'}{$key} or not exists $data->{$key} or not defined $data->{$key}
733 6 76 if (UNIVERSAL::isa($v, 'CODE'))
737 48 34 if (not ref $v) { }
18 16 elsif (ref $v eq 'BOOL') { }
10 6 elsif (ref $v eq 'ARRAY') { }
6 0 elsif (ref $v eq 'CSV') { }
740 43 5 if &looks_like_number($v)
742 16 32 if ($o{'no_key'}) { }
750 4 14 ref $v->[0] eq 'SCALAR' ? :
762 2 8 $o{'no_key'} ? :
771 2 16 if ($part =~ /&/) { }
781 2 4 if (@parts)
798 291 79 defined $default && length $default ? :