You are here

REST API login with x-data-dumper

2 posts / 0 new
Last post
damirda
damirda's picture
REST API login with x-data-dumper

I am trying to create simple script that will login via REST API and fetch some information, but I fail on the very first step.

In other to avoid any external dependencies (JSON/XML) I wanted to use Perl Data Dumper format for data exchange.

Whatever I've tried, I either get 'Error with input or output data' or response formated in JSON.

 

Would someone be so kind to share working example of script using Perl Data Dumper for data exchange?

 

D

tvoon
tvoon's picture
Re: REST API login with x-data-dumper

Have a look at the opsview_rest command. That is basically a small wrapper to communicate with the REST API as a browser, so you should be able to work out how to split that into your own script.

Alternatively, I know there are some CPAN modules that may help: http://search.cpan.org/~mruiz/Opsview-REST-0.011/

Ton