Archived
1
0
Fork 0

Fix API call

This commit is contained in:
Mercier Pierre-Olivier 2013-11-21 21:01:14 +01:00
commit 7f418a06fe
3 changed files with 11 additions and 4 deletions

View file

@ -105,8 +105,10 @@ sub send($$$)
log(DEBUG, 'POST Request to ', API_URL, $url);
my $req = POST API_URL . $url, shift;
my $cnt = $ua->request($req)->content;
my $res = $ua->request($req);
log TRACE, $res;
my $cnt = $res->content();
log TRACE, $cnt;
return parse($next, $cnt);

View file

@ -103,7 +103,10 @@ sub add_grades($;$)
my %data = (
project_name => shift
);
$data{year} = $_ if (shift);
my $y = shift;
if ($y) {
$data{year} = $y;
}
my $res = API::Base::send('ResultHandler', "projects/notes/add.xml", \%data);
@ -120,7 +123,10 @@ sub add_traces($$;$)
project_name => shift,
trace_name => shift,
);
$data{year} = $_ if (shift);
my $y = shift;
if ($y) {
$data{year} = $y;
}
my $res = API::Base::send('ResultHandler', "projects/traces/add.xml", \%data);

View file

@ -178,7 +178,6 @@ sub genIds ($;$)
}
else {
$ans_i += 1;
$cur_aid = $answer->{id};
}
}
}