cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
68
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Michael Schmidt on 17-06-2013 12:21:53 AM
Hi,

is it possible to "open" such HTTP-Link via Perl Script?

http://<em-server-ip>/emapp/EMAppServlet?device=SEP<mac>&&userid=<userid>&seq=<user-pin>

I don`t want really to open a web browser with this link but I want to make the EM profile login via the perl script and this HTTP-Link.

BR
Michael

Subject: RE: HTTP-Link via Perl?
Replied by: Martin Sloan on 17-06-2013 07:51:52 AM
Hi Michael,

Check out the LWP Perl mod.  Here's some structure for code I would use while doing POST/GET.  This might get the job done for EM, but I've never tried it specifically.  You'll have to install the LWP module and dependencies if you haven't already.

    my $url="https://AddressOfTheService";
    my $ua = LWP::UserAgent->new;
    my $header = HTTP::Headers->new;
    $header->header("Content-Type","application/xml");
    my $req = HTTP::Request->new(POST => $url, $header);
    $req->authorization_basic("Username","Password");
    my $response = $ua->request($req);

Also, there's a forum for the EMAPI where you might find more help:

http://developer.cisco.com/web/emapi/community/-/message_boards/category/1062473

Marty

Subject: RE: HTTP-Link via Perl?
Replied by: Martin Sloan on 17-06-2013 08:42:27 AM
Excellent!

Subject: RE: HTTP-Link via Perl?
Replied by: Michael Schmidt on 17-06-2013 08:35:17 AM
Hi Marty,

great this is working.

Many thanks.

BR
Michael
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links