NAME
REST::Cypher::Agent - Experimental client for using neo4j's REST/Cypher interface
VERSION
version 0.0.4
DESCRIPTION
Interact with a neo4j Cypher API.
ATTRIBUTES
base_url
This is the full URL value of the neo4j server to connect to.
base_url => http://my.neo4j.example.com:7474
It is a required attribute, with no default value.
cypher_url
This is the URL used to connect to the Cypher endpoint(s).
It is a derived value, based on base_url
agent_string
This attribute provides the value for the User Agent string when making API calls.
This attribute has a default value of REST::Cypher::Agent/0.0.0
, but may be overridden.
agent
This attribute holds the agent object, used for making the HTTP calls to the API endpoint.
The default value is an instance of LWP::UserAgent. You may override this. At your own risk.
auth_token
neo4j allows authentication to be enabled for connections to the database. For recent versions this is enabled by default.
The auth-token value is 'a base64 encoded string of "username:password"'
The default value is set to the equivalent of encode_base64('neo4j:neo4j')
.
last_response
This attribute stores the response object from the most recent call to the API. See HTTP::Response for a description of the interface it provides.
debug
This boolean attribute enables debugging output for the class.
METHODS
GET
This method provides low-level access to LWP::UserAgent-
get()>.
It takes care of constructing the URL, using the provided query parameters.
The method returns the response object, after storing it in last_response
.
# (just) GET the base URL
$response = $cypher_agent->GET({query_string => '' });
POST
GENERATING AUTH TOKEN
You can generate your own auth_token
value using MIME::Base64
perl -MMIME::Base64 -e "warn encode_base64('neo4j:neo4j');"
SEE ALSO
AUTHOR
Chisel <chisel@chizography.net>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Chisel Wright.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.