Skip to content

Commit

Permalink
[#2] POD
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
tomascohen committed Feb 21, 2025
1 parent 629b308 commit 6e98fe4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,14 +332,16 @@ sub borrower_item_returned {
$client->circulation_requests(
{
startTime => $epoch,
endTime => $epoch,
[ state => ['ACTIVE','COMPLETED','INACTIVE','CREATED','CANCELED'],
content => 'concise'|'verbose',
timeTarget => 'lastUpdated'|'dateCreated',
startTime => $epoch,
endTime => $epoch, ]
timeTarget => 'lastUpdated'|'dateCreated', ]
},
[ { skip_api_request => 0 | 1 } ]
);
All filtering options are not mandatory.
I<startTime> and I<endTime> are the only mandatory parameter.
=cut

Expand Down
24 changes: 22 additions & 2 deletions Koha/Plugin/Com/ByWaterSolutions/RapidoILL/lib/RapidoILL/OAuth2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,27 @@ sub put_request {

=head3 get_request
Generic request for GET
my $response = $client->get_request(
{
base_url => "https://www.bywatersolutions.com",
endpoint => "/some/endpoint",
[ query => {
param_1 => "123",
...
param_2 => [ "ASD", "QWE" ],
} ]
}
);
Generic request for GET.
Both $<base_url> and I<endpoint> parameters are mandatory. I<query> should
be a hashref where keys are the query parameters pointing to desired values.
If the value is an arrayref, then the query parameter will get repeated
for each of the contained values.
In the example above, the generated query will be
B<https://www.bywatersolutions.com/some/endpoint?param_1="123"&param_2="ASD"&param_2="QWE">
=cut

Expand All @@ -162,7 +182,7 @@ sub get_request {
$uri->query_form( %{ $args->{query} } );
$query = $uri;
}
p($query);

my $request = GET(
$self->{base_url} . $args->{endpoint} . $query,
'Authorization' => "Bearer " . $self->get_token,
Expand Down

0 comments on commit 6e98fe4

Please sign in to comment.