7-api-sequencing #8
@ -297,10 +297,10 @@ unless($DRY_RUN) {
|
||||
# Create
|
||||
foreach my $record (@to_create) {
|
||||
my $res = $ua->post(
|
||||
$record[0],
|
||||
$record->[0],
|
||||
"Content-Type" => "application/json",
|
||||
Content => to_json({
|
||||
records => [ $record[1] ]
|
||||
records => [ $record->[1] ]
|
||||
})
|
||||
);
|
||||
warn "Failed to create $url: " . $res->status_line . "\n" . $res->content unless $res->is_success;
|
||||
@ -309,9 +309,9 @@ unless($DRY_RUN) {
|
||||
# Update
|
||||
foreach my $record (@to_update) {
|
||||
my $res = $ua->put(
|
||||
$record[0],
|
||||
$record->[0],
|
||||
"Content-Type" => "application/json",
|
||||
"Content" => to_json({ records => [ $record[1] ] }),
|
||||
"Content" => to_json({ records => [ $record->[1] ] }),
|
||||
);
|
||||
warn "Failed to update $url: " . $res->status_line unless $res->is_success;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user