Net::IMP::HTTP::Example::SaveResponse - save response data to file system
# use App::HTTP_Proxy_IMP to listen on 127.0.0.1:8000 and save all data
# in myroot/
$ perl bin/imp_http_proxy --filter Example::SaveResponse=root=myroot 127.0.0.1:8000
This module is used to save response data into the file system.
The module has the following arguments for new_analyzer:
The base directory for saving the data. This argument is required.
Limits saving of the response body the given content_types, either hash, string or regular expression. If not given everything can be saved.
Limits saving to the given methods, either hash, string or regular expression. If not given everything can be saved.
No data will be saved, if the request or response body size is greater then the given limit. If not given a default of 10_000_000 will be assumed. For unlimited saving this can be set to 0.
If set the contents of the query string or the post data will not be used in creating the file name.
This regular expression describes, which URLs will not be saved. E.g. setting it to /\?/ causes no URLs with a query string to be saved. If not given everything can be saved.
If given, this regular expression limits saving to matching URLs. If not given everything can be saved.
The module has a single argument root for new_analyzer. root specifies the base directory, where the data get saved. The data are saved into a file root/host:port/method-md5path-md5data, where
method is the HTTP method, lower cased
md5path is the md5 hash of the path, e.g. excluding query string
md5data is the md5 hash over query string joined with post data
The contents of the saved file consists of the HTTP request header and body, followed by the response header and body. Chunking and content-encoding is removed from the body.. To speedup extraction of each of these 4 parts from the file an index of 16 byte is added at the end of the file consisisting of 4 32bit unsigned integers in network byte order, describing the size of each part.
Steffen Ullrich <email@example.com>
To install Net::IMP::HTTP, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.