Commit 9d1c4b08b2144f990fc97041653845eee1e3581d
- Diff rendering mode:
- inline
- side by side
lib/LWP/UserAgent.pm
(14 / 8)
|   | |||
| 1026 | 1026 | ||
| 1027 | 1027 | KEY DEFAULT | |
| 1028 | 1028 | ----------- -------------------- | |
| 1029 | agent "libwww-perl/#.##" | ||
| 1029 | agent "libwww-perl/#.###" | ||
| 1030 | 1030 | from undef | |
| 1031 | 1031 | conn_cache undef | |
| 1032 | 1032 | cookie_jar undef | |
| … | … | ||
| 1089 | 1089 | =item $ua->_agent | |
| 1090 | 1090 | ||
| 1091 | 1091 | Returns the default agent identifier. This is a string of the form | |
| 1092 | "libwww-perl/#.##", where "#.##" is substituted with the version number | ||
| 1092 | "libwww-perl/#.###", where "#.###" is substituted with the version number | ||
| 1093 | 1093 | of this library. | |
| 1094 | 1094 | ||
| 1095 | 1095 | =item $ua->from | |
| … | … | ||
| 1157 | 1157 | Get/set the C<LWP::ConnCache> object to use. See L<LWP::ConnCache> | |
| 1158 | 1158 | for details. | |
| 1159 | 1159 | ||
| 1160 | =item $ua->credentials( $netloc, $realm ) | ||
| 1161 | |||
| 1160 | 1162 | =item $ua->credentials( $netloc, $realm, $uname, $pass ) | |
| 1161 | 1163 | ||
| 1162 | Set the user name and password to be used for a realm. It is often more | ||
| 1163 | useful to specialize the get_basic_credentials() method instead. | ||
| 1164 | Get/set the user name and password to be used for a realm. | ||
| 1164 | 1165 | ||
| 1165 | The $netloc a string of the form "<host>:<port>". The username and | ||
| 1166 | The $netloc is a string of the form "<host>:<port>". The username and | ||
| 1166 | 1167 | password will only be passed to this server. Example: | |
| 1167 | 1168 | ||
| 1168 | 1169 | $ua->credentials("www.example.com:80", "Some Realm", "foo", "secret"); | |
| … | … | ||
| 1323 | 1323 | =head2 Handlers | |
| 1324 | 1324 | ||
| 1325 | 1325 | Handlers are code that injected at various phases during the | |
| 1326 | processing of requests. | ||
| 1326 | processing of requests. The following methods are provided to manage | ||
| 1327 | the active handlers: | ||
| 1327 | 1328 | ||
| 1328 | 1329 | =over | |
| 1329 | 1330 | ||
| 1330 | 1331 | =item $ua->add_handler( $phase => \&cb, %matchspec ) | |
| 1331 | 1332 | ||
| 1332 | 1333 | Add handler to be invoked in the given processing phase. For how to | |
| 1333 | specify %matchspec see L<HTTP::Config>. | ||
| 1334 | specify %matchspec see L<HTTP::Config/"Matching">. | ||
| 1334 | 1335 | ||
| 1335 | The possible values $phase are: | ||
| 1336 | The possible values $phase and the corresponding callback signatures are: | ||
| 1336 | 1337 | ||
| 1337 | 1338 | =over | |
| 1338 | 1339 | ||
| … | … | ||
| 1406 | 1406 | ||
| 1407 | 1407 | Remove handlers that match the given %matchspec. If $phase is not | |
| 1408 | 1408 | provided remove handlers from all phases. | |
| 1409 | |||
| 1410 | Be careful as calling this function with %matchspec that is not not | ||
| 1411 | specific enough can remove handlers not owned by you. It's probably | ||
| 1412 | better to use the set_my_handler() method instead. | ||
| 1409 | 1413 | ||
| 1410 | 1414 | The removed handlers are returned. | |
| 1411 | 1415 |

