Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Sorry,I've changed my posting. And about your question:
I think my Problem is to separate my hush in right way:

(my $id, $first{$name}, $second{$name}) = split /,/;

There is no Problem with the server
I've tested it already with this code:

open ( my $input_1, '<', 'output1.csv' ) or die $!; while ( <$input_1> ) { chomp; my ($name_1, $ip_1) = split /,/; my $xml = XML::Twig -> new -> parsefile ( 'example.xml' ); $xml ->set_pretty_print('indented_a'); open ( my $input_2, '<', 'output2.csv' ) or die $!; while ( <$input_2> ) { chomp; (my $id, $first{$name}, $second{$name}) = split /,/; $xml -> root -> set_att('name', $name_1); $xml -> get_xpath('//ipaddress',0) -> set_text($ip_1); my $uri="https://hostname:9060/ers/config/networkdevice/$id"; my $req = HTTP::Request->new('PUT', $uri, [Accept=>'application/vnd.com.cisco.ise.network.networkdevice.1.1 ++xml', Content_Type=>'application/vnd.com.cisco.ise.network.networkdevic +e.1.1+xml; charset=utf-8'], $xml->sprint); $req->content($xml->sprint); $req->authorization_basic("user", "user");

It works, but it works wrong!This code updates every device (also identical devices) And I have this message.After Update it tries to do smth(I do not understand what)and I become 400,405 Http Status. I also get warnings:

UPDATE need be done for 10.56.7.80 200 OK 400 Bad Request Use of uninitialized value $id in concatenation (.) or string at My_Fi +le line 65, <$_[...]> line 3. 405 Method Not Allowed Use of uninitialized value $id in concatenation (.) or string at My_Fi +le line 65, <$_[...]> line 4. 405 Method Not Allowed 400 Bad Request

10.56.7.80 example ip address

Line 65: my $uri="https://10.66.1.16:9060/ers/config/networkdevice/$id +";

In reply to Re^2: HTTP PUT Request with separate values in csv by StayCalm
in thread HTTP PUT Request with separate values in csv by StayCalm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-16 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found