NAME

WebService::Qdrant::UA - HTTP transport for Qdrant

VERSION

version 0.0001

SYNOPSIS

my $ua = WebService::Qdrant::UA->new(
    base_url => 'http://localhost:6333',
    timeout  => 30,
);
my $response = $ua->put(
    url   => '/collections/notes',
    query => { timeout => 10 },
    data  => { vectors => { size => 3, distance => 'Cosine' } },
);

DESCRIPTION

Sends ordinary JSON requests using LWP::UserAgent. Every server response, including HTTP errors and malformed JSON, becomes a WebService::Qdrant::Response. Transport failures throw exceptions.

SUBROUTINES/METHODS

new

Accepts the attributes below. Construction does not contact the server.

get

Sends a GET request.

put

Sends a PUT request.

post

Sends a POST request.

delete

Sends a DELETE request.

HTTP method shortcuts accepting url, optional query (a hash reference of URL parameters), and optional data (the JSON body). The endpoint path must begin with one slash and should already contain escaped path segments. The base URL may end with a slash. JSON boolean query values become the text true or false. Arguments are not modified.

Omitting data sends no body. An empty hash reference sends a JSON object. URL parameters and JSON body fields are deliberately separate.

request

Accepts the same arguments and a type of GET, PUT, POST, or DELETE. Returns one response object.

response

Converts an HTTP::Response into a Qdrant response. LWP synthetic responses marked Client-Warning: Internal response throw with the transport error. A server HTTP 500 without that marker is returned normally.

ATTRIBUTES

base_url

Service URL; defaults to http://localhost:6333.

api_key

Optional key set as the default api-key header on the generated HTTP client.

timeout

LWP timeout in seconds, default 30. Separate from Qdrant operation timeouts.

ua

Optional injected LWP-compatible HTTP client. Used as supplied; configure its headers and timeout yourself. Otherwise constructed lazily and reused.

json

JSON encoder, default JSON::MaybeXS configured for UTF-8 bytes.

DIAGNOSTICS

Invalid request arguments and JSON encoding failures throw, as do transport failures such as refused connections, DNS errors, and timeouts. Completed HTTP exchanges return response objects even when the server reports an error.

SEE ALSO

WebService::Qdrant, WebService::Qdrant::Response

AUTHOR

D Ruth Holloway <ruth@hiruthie.me>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by D Ruth Holloway.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.