Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lwp::protocol::ldap(3) [osx man page]

LWP::Protocol::ldap(3)					User Contributed Perl Documentation				    LWP::Protocol::ldap(3)

LWP::Protocol::ldap - Provide LDAP support for LWP::UserAgent SYNOPSIS
use LWP::UserAgent; $ua = LWP::UserAgent->new(); $res = $ua->get('ldap://' . 'o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)', Accept => 'text/json'): DESCRIPTION
The LWP::Protocol::ldap module provides support for using ldap schemed URLs following RFC 4516 with LWP. This module is a plug-in to the LWP protocol handling, so you don't use it directly. In addition to being used with LDAP URIs, LWP::Protocol::ldap also acts as the base class for its sibling modules LWP::Protocol::ldaps and LWP::Protocol::ldapi. Features HTTP methods supported LWP::Protocol::ldap implements the HTTP GET and HEAD methods. They are mapped to the LDAP search operation, Response format Depending on the HTTP Accept header provided by the user agent, LWP::Protocol::ldap can answer the requests in one of the following formats: DSML When the HTTP Accept header contains the "text/dsml" MIME type, the response is sent as DSMLv1. JSON When the HTTP Accept header contains the "text/json" MIME type, the response is sent as JSON. For this to work the JSON Perl module needs to be installed. LDIF When the HTTP Accept header contains the "text/ldif" MIME type, the response is sent in LDIFv1 format. HTML In case no HTTP Accept header has been sent or none of the above MIME types can be detected, and the x-format extension has not been provided either, the response is sent using HTML markup in a 2-column table format (roughly modeled on LDIF). As an alternative to sending an HTTP Accept header, LWP::Protocol::ldap also accepts the "x-format" extension Example: ldap://,c=US??sub?(cn=Babs%20Jensen)?x-format=dsml TLS support For ldap and ldapi URIs, the module implements the "x-tls" extension that switches the LDAP connection to TLS using a call of the start_tls method. Example: ldap://,c=US??sub?(cn=Babs%20Jensen)?x-tls=1 Note: In the above example, ideally giving "x-tls" should be sufficient, but unfortunately the parser in URI::ldap has a little flaw. Authorization Usually the connection is done anonymously, but if the HTTP Authorization header is provided with credentials for HTTP Basic authorization, the credentials given in that header will be used to do a simple bind to the LDAP server. SEE ALSO
LWP::Protocol::ldaps, LWP::Protocol::ldapi COPYRIGHT
Copyright (c) 1998-2004 Graham Barr, 2012 Peter Marschall. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-09-20 LWP::Protocol::ldap(3)

Check Out this Related Man Page

LWP::Protocol::PSGI(3pm)				User Contributed Perl Documentation				  LWP::Protocol::PSGI(3pm)

LWP::Protocol::PSGI - Override LWP's HTTP/HTTPS backend with your own PSGI applciation SYNOPSIS
use LWP::UserAgent; use LWP::Protocol::PSGI; # can be Mojolicious, Catalyst ... any PSGI application my $psgi_app = do { use Dancer; setting apphandler => 'PSGI'; get '/search' => sub { return 'googling ' . params->{q}; }; dance; }; LWP::Protocol::PSGI->register($psgi_app); # can hijack any code or module that uses LWP::UserAgent underneath, with no changes my $ua = LWP::UserAgent->new; my $res = $ua->get(""); print $res->content; # "googling bar" DESCRIPTION
LWP::Protocol::PSGI is a module to hijack any code that uses LWP::UserAgent underneath such that any HTTP or HTTPS requests can be routed to your own PSGI application. Because it works with any code that uses LWP, you can override various WWW::*, Net::* or WebService::* modules such as WWW::Mechanize, without modifying the calling code or its internals. use WWW::Mechanize; use LWP::Protocol::PSGI; LWP::Protocol::PSGI->register($my_psgi_app); my $mech = WWW::Mechanize->new; $mech->get(""); # $my_psgi_app runs METHODS
register LWP::Protocol::PSGI->register($app); my $guard = LWP::Protocol::PSGI->register($app); Registers an override hook to hijack HTTP requests. If called in a non-void context, returns a Guard object that automatically resets the override when it goes out of context. { my $guard = LWP::Protocol::PSGI->register($app); # hijack the code using LWP with $app } # now LWP uses the original HTTP implementations unregister LWP::Protocol::PSGI->unregister; Resets all the overrides for LWP. If you use the guard interface described above, it will be automatically called for you. AUTHOR
Tatsuhiko Miyagawa <> COPYRIGHT
Copyright 2011- Tatsuhiko Miyagawa LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Plack::Client LWP::UserAgent perl v5.12.3 2011-05-12 LWP::Protocol::PSGI(3pm)
Man Page

Featured Tech Videos