NAME

dta-cab-http-client.perl - Generic HTTP client for DTA::CAB::Server::HTTP queries

SYNOPSIS

 dta-cab-http-client.perl [OPTIONS...] ARGUMENTS

 General Options:
  -help                           ##-- show short usage summary
  -man                            ##-- show longer help message
  -version                        ##-- show version & exit
  -verbose LEVEL                  ##-- set default log level

 Client Options:
  -server URL                     ##-- set server URL (default: http://localhost:9099)
  -timeout SECONDS                ##-- set server timeout in seconds (default: lots)
  -test-connect , -notest-connect ##-- do/don't send a test request to the server (default: don't)
  -trace FILE                     ##-- trace request(s) sent to the server to FILE
  -header HEADER=VALUE            ##-- set additional HTTP header
  -cache-get , -nocache-get       ##-- enable/disable cached response from server (Cache-Control: no-cache)
  -cache-set , -nocache-set       ##-- enable/disable caching of server response  (Cache-Control: no-store)
  -cache     , -nocache           ##-- alias for -[no]cache-get -[no]cache-set
  -get                            ##-- query server using URL-only GET requests
  -post                           ##-- query server using use content-only POST requests
  -multipart , -nomultipart       ##-- for POST requests, do/don't use 'multipart/form-data' encoding (default=don't)
  -xpost                          ##-- query server using URL+content POST requests (default)
  -xmlrpc                         ##-- query server using XML-RPC requests

 Analysis Options:
  -list                           ##-- just list registered analyzers
  -analyzer NAME                  ##-- set analyzer name (default: 'default')
  -analyze-option OPT=VALUE       ##-- set analysis option (default: none)
  -profile , -noprofile           ##-- do/don't report profiling information (default: don't)
  -token                          ##-- ARGUMENTS are token text
  -sentence                       ##-- ARGUMENTS are analyzed as a sentence
  -document                       ##-- ARGUMENTS are filenames, analyzed as documents (default)
  -data                           ##-- ARGUMENTS are filenames, analyzed as documents with server-side parsing
  -raw                            ##-- ARGUMENTS are strings, analyzed as raw untokenized text
  -rawfile                        ##-- ARGUMENTS are filenames, analyed as raw untokenized text

 I/O Options:
  -(input|query|output)-format-(class|option)
  -format-class CLASS             ##-- set {query,input,output} format classes at once
  -format-option                  ##-- set {query,input,output} format options at once
                                  ##-- for non -data mode, set I/O format options
  -output-format-level LEVEL      ##-- override output format level (default: 0)
  -output-file FILE               ##-- set output file (default: STDOUT)

 Logging Options                  ##-- see Log::Log4perl(3pm)
  -log-level LEVEL                ##-- set minimum log level (default=TRACE)
  -log-stderr , -nolog-stderr     ##-- do/don't log to stderr (default=true)
  -log-syslog , -nolog-syslog     ##-- do/don't log to syslog (default=false)
  -log-file LOGFILE               ##-- log directly to FILE (default=none)
  -log-rotate , -nolog-rotate     ##-- do/don't auto-rotate log files (default=true)
  -log-config L4PFILE             ##-- log4perl config file (overrides -log-stderr, etc.)
  -log-watch  , -nowatch          ##-- do/don't watch log4perl config file (default=false)
  -log-option OPT=VALUE           ##-- set any logging option (e.g. -log-option twlevel=trace)

DESCRIPTION

dta-cab-http-client.perl is a command-line client for DTA::CAB analysis of token(s), sentence(s), and/or document(s) by querying a running DTA::CAB::Server::HTTP server with the DTA::CAB::Client::HTTP module.

See dta-cab-http-server.perl(1) for a corresponding server.

OPTIONS AND ARGUMENTS

General Options

-help

Display a short help message and exit.

-man

Display a longer help message and exit.

-version

Display program and module version information and exit.

-verbose

Set default log level (trace|debug|info|warn|error|fatal).

Client Options

-server URL

Set server URL (default: http://localhost:8000). To query a UNIX-domain CAB-server (DTA::CAB::Server::HTTP::UNIX) on /path/to/cab.sock, you can specify the URL using either the LWP::Protocol::http::SocketUnixAlt or apache mod_proxy sytax; the following are equivalent:

 http:/path/to/cab.sock//uri/path
 unix:/path/to/cab.sock|http:///uri/path
 unix:///path/to/cab.sock|http:///uri/path
 http+unix:/path/to/cab.sock//uri/path
 http+unix:/path/to/cab.sock|/uri/path
-timeout SECONDS

Set server timeout in seconds (default: lots).

-test-connect , -notest-connect

Do/don't send a test HEAD request to the server (default: do).

-trace FILE

If specified, all client requests will be logged to FILE.

Analysis Options

-list

Don't actually perform any analysis; rather, just print a list of analyzers registered with the server.

-analyzer NAME

Request analysis by the analyzer registered under name NAME (default: 'default').

-analyze-option OPT=VALUE

Set an arbitrary analysis option OPT to VALUE. May be multiply specified.

Available options depend on the analyzer class to be called.

-profile , -noprofile

Do/don't report profiling information (default: do).

-token

Interpret ARGUMENTS as token text.

-sentence

Interpret ARGUMENTS as a sentence (list of tokens).

-document

Interpret ARGUMENTS as filenames, to be analyzed as documents. This is the default action.

-data

Currently just an alias for -document.

I/O Options

-format-class CLASS

Select I/O format class CLASS. Default is TT. CLASS may be any alias supported by DTA::CAB::Format::newFormat.

-format-option OPT=VALUE

Set an arbitrary I/O format option. May be multiply specified.

-format-encoding ENCODING

Set I/O encoding; default=UTF-8.

-format-level LEVEL

Override output format level (default: 1).

-output-file FILE

Set output file (default: STDOUT).

ACKNOWLEDGEMENTS

Perl by Larry Wall.

RPC::XML by Randy J. Ray.

AUTHOR

Bryan Jurish <moocow@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2010-2019 by Bryan Jurish. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.24.1 or, at your option, any later version of Perl 5 you may have available.

SEE ALSO

dta-cab-analyze.perl(1), dta-cab-convert.perl(1), dta-cab-cachegen.perl(1), dta-cab-http-server.perl(1), dta-cab-http-client.perl(1), dta-cab-xmlrpc-server.perl(1), dta-cab-xmlrpc-client.perl(1), DTA::CAB(3pm), RPC::XML(3pm), perl(1), ...