|
NAMEHTTP::Link::Parser - parse HTTP Link headersSYNOPSISuse HTTP::Link::Parser ':standard'; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->get("http://example.com/foo"); # Parse link headers into an RDF::Trine::Model. my $model = parse_links_into_model($response); # Find data about <http://example.com/foo>. my $iterator = $model->get_statements( RDF::Trine::Node::Resource->new('http://example.com/foo'), undef, undef); while ($statement = $iterator->next) { # Skip data where the value is not a resource (i.e. link) next unless $statement->object->is_resource; printf("Link to <%s> with rel=\"%s\".\n", $statement->object->uri, $statement->predicate->uri); } DESCRIPTIONHTTP::Link::Parser parses HTTP "Link" headers found in an HTTP::Response object. Headers should conform to the format described in RFC 5988.FunctionsTo export all functions:use HTTP::Link::Parser ':all';
Internal FunctionsThese are really just internal implementations, but you can use them if you like.
BUGSPlease report any bugs to <http://rt.cpan.org/>.SEE ALSO<http://www.ietf.org/rfc/rfc5988.txt>.RDF::Trine, HTTP::Response, XRD::Parser, HTTP::LRDD. <http://n2.talis.com/wiki/RDF_JSON_Specification>. <http://www.perlrdf.org/>. AUTHORToby Inkster <tobyink@cpan.org>.COPYRIGHT AND LICENCECopyright (C) 2009-2011, 2014 by Toby InksterPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Visit the GSP FreeBSD Man Page Interface. |