Bugzilla – Attachment 6282 Details for
Bug 7213
Document /svc/ HTTP API and provide example command-line client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7213: simple /svc/ HTTP example
Bug-7213-simple-svc-HTTP-example.patch (text/plain), 1.69 KB, created by
Dobrica Pavlinusic
on 2011-11-10 22:27:36 UTC
(
hide
)
Description:
Bug 7213: simple /svc/ HTTP example
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2011-11-10 22:27:36 UTC
Size:
1.69 KB
patch
obsolete
>From d0e612e191e761238941b333ba4a03027389270d Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Thu, 10 Nov 2011 21:39:55 +0100 >Subject: [PATCH] Bug 7213: simple /svc/ HTTP example > >Simple command-line client which can authorize itself to Koha, >get MARC XML record based on biblio number and update record >--- > misc/migration_tools/koha-svc.pl | 43 ++++++++++++++++++++++++++++++++++++++ > 1 files changed, 43 insertions(+), 0 deletions(-) > create mode 100755 misc/migration_tools/koha-svc.pl > >diff --git a/misc/migration_tools/koha-svc.pl b/misc/migration_tools/koha-svc.pl >new file mode 100755 >index 0000000..d0d1c7c >--- /dev/null >+++ b/misc/migration_tools/koha-svc.pl >@@ -0,0 +1,43 @@ >+#!/usr/bin/perl >+ >+use warnings; >+use strict; >+ >+use LWP::UserAgent; >+use File::Slurp; >+ >+my $url = 'http://srvgit.koha-dev.rot13.org:8080/cgi-bin/koha/svc'; >+ >+my $biblionumber = 252283; >+ >+my $file = "bib-$biblionumber.marcxml"; >+ >+my $user = 'svcuser'; >+my $password = 'svcpasswd'; >+my $debug = 1; >+ >+my $ua = LWP::UserAgent->new(); >+$ua->cookie_jar({}); >+my $resp = $ua->post( "$url/authentication", {userid =>$user, password => $password} ); >+die $resp->status_line unless $resp->is_success; >+print $resp->decoded_content; >+ >+if ( ! -e $file ) { >+ >+ $resp = $ua->get( "$url/bib/$biblionumber" ); >+ die $resp->status_line unless $resp->is_success; >+ write_file $file, $resp->decoded_content; >+ print "saved $file ", -s $file, " bytes\n"; >+ print $resp->decoded_content; >+ >+} >+ >+print "update $biblionumber from $file\n"; >+$resp = $ua->post( "$url/bib/$biblionumber", { >+ POSTDATA => scalar read_file($file), >+} ); >+die $resp->status_line unless $resp->is_success; >+ >+print $resp->decoded_content; >+ >+ >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7213
:
6276
|
6277
|
6280
|
6281
|
6282
|
8449
|
8466
|
9004
|
9257
|
9258
|
9265
|
9575