REST2 Perl Client

I’m wondering if there is any Perl client modules in the work that use REST 2.0, similar to the RT::Client::REST collection for 1.0. Currently, I’m only needing to create tickets from an outside source. If nothing is in the works, then I’ll just develop my on libs for the small set of features that I require.

Thanks.

I have been working with the REST 2.0 interface and seeing what perl modules were available. The one that really seems to allow for very simple scripting is the WWW::JSON module. I did find that the module assumed that the only data type is a JSON hash. This meant that JSON searches which use an array of hashes failed. The following patch fixed that and allowed it to work. I have passed it back to the module author:

— ./.local/share/.cpan/build/WWW-JSON-1.02-Leh0oW/lib/WWW/JSON.pm 2015-05-27 14:06:19.000000000 -0500
+++ ./perl5/lib/perl5/WWW/JSON.pm 2020-03-29 12:28:59.214671647 -0500
@@ -95,8 +95,14 @@
( $path, $params ) = $self->_do_templating( $path, $params )
if ( $path =~ /[%.*%]/ );
my $body_params;

  • $body_params = { %{ $self->body_params }, %{$params} }
  •  if $self->_http_method_uses_post_body($method);
    
  • if ( $self->_http_method_uses_post_body($method) ) {
  •    if ( ref($params) eq 'HASH' ) {
    
  •        $body_params = { %{ $self->body_params }, %{$params} };
    
  •    } elsif ( ref($params) eq 'ARRAY' ) {
    
  •        # ignoring body_params for arrays
    
  •        $body_params = $params;
    
  •    }
    
  • }
    unless ( path->_isa(‘URI’) && $path->scheme ) {
    $path =~ s|^/|./|;
    $path = URI->new($path);

Hope this helps.

Regards,
Ken