Skip to content

Commit

Permalink
Switched lwp_post to lwp_put and fixed route
Browse files Browse the repository at this point in the history
This is to align with the new verb and route for modifying the configuration database.
  • Loading branch information
KevinMackenzie committed Oct 20, 2017
1 parent aa6fa18 commit 11c24ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions traffic_ops/bin/traffic_ops_ort.pl
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
print "Testing cfg Api\n";
my $meme_test = &lwp_get("/api/1.2/servers/1/cfg.json");
print "$meme_test\n";
my $cfg_test = &lwp_post('/api/1.2/servers/1/cfg', '{"serverId": 1, "fileName": "test1.cfg", "dbLines": ["dbLine1", "dbLine1", "dbline2"], "localLines": ["localLine1", "localLine2", "localLine3"]}');
my $cfg_test = &lwp_put('/api/1.2/servers/1/test_config2.cfg', '{"serverId": 1, "fileName": "test1.cfg", "dbLines": ["dbLine1", "dbLine1", "dbline2"], "localLines": ["localLine1", "localLine2", "localLine3"]}');
print "$cfg_test\n";
print "End Testing cfg Api\n";

Expand Down Expand Up @@ -1467,7 +1467,7 @@ sub lwp_get {

}

sub lwp_post {
sub lwp_put {
my $uri = shift;
my $body = shift;
my $retry_counter = $retries;
Expand All @@ -1493,7 +1493,7 @@ sub lwp_post {
}

# TODO: is there a way to generalize this for most verbs?
my $httpRequest = HTTP::Request->new( 'POST', $request );
my $httpRequest = HTTP::Request->new( 'PUT', $request );
$httpRequest->header( 'Cookie' => $cookie );
$httpRequest->header( 'Content-Type' => 'application/json' );
$httpRequest->content( $body );
Expand Down

0 comments on commit 11c24ff

Please sign in to comment.